Jesus has cleared the path for us to come back to God. However, in order for us to be reunited in a right relationship with God, we have to CHOOSE to walk the path that Jesus has cleared.
First, we have to admit that we have a sin problem, and that we are never going to be able to fix it on our own. We cannot earn our way back to God. We have to turn away FROM our sins (what the Bible calls "repentance") to Jesus in faith (Acts 3:19).
Then, we must choose to accept/agree that Christ is the one and only way to reconnect with God. When we surrender to Jesus and trust in His work on the cross for the forgiveness of our sins—instead of in our own good works/efforts—we are given “the right to become children of God.” (John 1:12) We are saved FROM the curse and consequences of sin TO an eternal life of peace and joy in unbroken community with God!
When you make that decision, baptism is the way you outwardly express the choice you have made with your mind and heart.
The act of baptism doesn't save you, but it is important because it is the expected, normal response when you receive Christ (Acts 2:37-38; 8:36-39; 16:29-34). It is the way you joyfully announce your repaired relationship with God to the world!