“Go ye therefore, and teach all nations, baptizing them … Teaching them to observe all things whatsoever I have commanded you” (Matthew 28:19, 20).
“He that believeth and is baptized shall be saved” (Mark 16:16).
“Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins” (Acts 2:38).
The three verses above summary the three prerequisites for baptism: knowledge, belief, and action.
Every candidate for baptism should be instructed in God’s basic doctrines before entering the water of baptism (Matthew 28:19). You need to understand the significance of the commitment you are about to make: to change your behavior to emulate Christ, to focus your thoughts on God’s kingdom, and to remove self from the throne of your life and replace it with God.
Obviously, before being baptized, you need to believe in God.
More than that, you need to believe what Jesus did for you with His life and death. You accept as true that Jesus lived a perfect life, then suffered and died to pay the penalty of sin for you. Baptism is your public confession to the world that Jesus is now Lord of your life. It is also symbolic of you following Jesus in His death, burial, and resurrection.
“Therefore we are buried with him by baptism into death: that like as Christ was raised up from the dead by the glory of the Father, even so we also should walk in newness of life. For if we have been planted together in the likeness of his death, we shall be also in the likeness of his resurrection: Knowing this, that our old man is crucified with him, that the body of sin might be destroyed, that henceforth we should not serve sin” (Romans 6:4-6).
Repentance is the turning away from sin. Before baptism, you need to confess your sins and turn away from them. It is a conscious choice to put your past behind you and start a new life walking with the power of God in you.
As far as age, many children are ready for baptism at 9 or 10 years of age, some at 7 or 8. And some are not ready at 12 or 13. No age level is specified in the Bible, because children have different levels of experience and understanding. Some are ready for baptism earlier than others.