The Apostle Peter said that baptism is not a literal washing away of filth/sin but is the response of a good conscience toward God.
Because we are saved, our sins have been washed away, and our conscience is clear with God we submit to the ritual of baptism as a public display of what has happened within and as a declaration that the old person is dead, so we are burying him, are now risen to walk in new life.
A couple of alternate readings to
1 Peter 3:21 are:
"in baptism we show that we have been saved from death and doom by the resurrection of Christ"
and
"Baptism, which corresponds to this, now saves you through the resurrection"
P.S. not every time the word "baptism" is found in the Bible does it have to the ritual of water baptism.