Martin Luther asked and answered that question in his Small Catechism. “What does Baptism do for us? Baptism works forgiveness of sin, delivers from death and the devil, and gives eternal salvation to all who believe this, as the words and promises of God declare. What are these words and promises of God? Christ our Lord says in the last chapter of Mark, ‘Whoever believes and is baptized will be saved, but whoever does not believe will be condemned.’”
Other Bible passages that answer your question are Acts 2:38; Romans 6:3; Galatians 3:26-27; Titus 3:5-7; and, 1 Peter 3:20-21.