This is the last refuge of the argument against baptism. “The thief on the cross was saved without being baptized.”
The thief on the cross received his promise from Jesus while Jesus was still alive. And that matters — more than most people realize. The writer of Hebrews explains:
“For where a covenant is, there must of necessity be the death of the one who made it. For a covenant is valid only when men are dead, for it is never in force while the one who made it lives.”
— Hebrews 9:16–17
A will — a testament — does not go into effect while the person who made it is still living. You do not inherit under a will while the testator is alive. The New Testament — the new covenant, the new will — was not in force while Jesus lived. It went into effect at His death.
The thief lived under the old covenant. Jesus, while He walked the earth, had authority to forgive sins directly (Matthew 9:6) — and He exercised that authority with the thief. The thief is not an example of how people are saved under the new covenant. He is an example of Jesus’ personal authority exercised under the old one.
Your template is not the thief. Your template is Acts 2 — Peter preaching under the new covenant and telling people to repent and be baptized for the forgiveness of their sins. Your template is Acts 22:16 — Ananias telling Saul to be baptized and wash away his sins. Your template is Romans 6 — buried with Christ and raised to walk in newness of life.