Salvation is by being baptized by the Holy Spirit, NOT by being immersed in water. Which Peter explained in 1 Pet 3:20-21.
...in the days of Noah, while the ark was being prepared, in which a few, that is, eight souls, were saved through water.21 There is also an antitype which now saves us—baptism (not the removal of the filth of the flesh, but the answer of a good conscience toward God), through the resurrection of Jesus Christ, 22 who has gone into heaven and is at the right hand of God, angels and authorities and powers having been made subject to Him. 1 Peter 3:20-22
Peter is referring to water Baptism... as he plainly says: not the removal of the filth of the flesh...
This is a clear reference to water [washing the with water], in which Peter teaches water baptism is not about washing filth from your flesh, but it's about having a good conscience before God, because you have obeyed and repented by being baptized with a baptism of repentance.
A good conscience comes from having your sins forgiven, which only comes by repentance.
Read for yourself what this same Peter said on the day of Pentecost to those who did not have a good conscience, but were
"cut to the heart" at his preaching...
Now when they heard this, they were cut to the heart, and said to Peter and the rest of the apostles, “Men and brethren, what shall we do?”... Then Peter said to them, “Repent, and let every one of you be baptized in the name of Jesus Christ for the remission of sins;
Acts 2:36,38
JLB