Right standing before God is necessary prior to baptism. Baptism is for believers (He that believeth and is baptized shall be saved: but he that believeth not shall be damned (Mk. 16:16; Acts 8:36-37; Acts16:30-33) Obedience releases/activates faith. Faith is demonstrated through baptism (Mk 16:16). No unbelievers should be baptized.
When a person trusts the cross, they are ready to come out of "Egypt" (a type of the world.) The Red Sea separated God's people from Egypt. They were "delivered" through the Red Sea (a type of water baptism.) Without faith, nothing happens in baptism; with faith, the believer rises to walk in newness of life.
Baptism aligns us with the headship of the Lord Jesus Christ (Acts 19:1-5)
Baptism is a circumcision of the heart. (Col 2:9-13) Abraham was justified before circumcision. Circumcision deals with verification, validation and authenticity of the faith that was already there. Baptism is a seal of the righteousness of my faith. It also cuts the enmity of the old nature of sin. It cuts away something from the heart. It deals with deliverance (Rom 6:1-14)
Baptism identifies us with Christ in his death. What the believer has just been delivered from (the old man) is buried, crucified, put away. "His" life is over. The believer should no longer serve sin but seek God's plans, purposes, etc. When a believer is baptized, it is a death to themselves and a resurrection to Christ through them.
According to Romans 4:11 baptism should be received, just like Abraham received the sign of circumcision, a seal of righteousness.
A believer should be baptized in the name (person, character, nature) of Jesus. To be baptized is to be immersed into Jesus. Jesus is the fullness of the Godhead bodily.
If a person believes and confesses, they need to be instructed about baptism. (Acts 8:36-37) Water baptism is the answer of a good conscience toward God (1 Peter 3:21)