Peter uses the story of Noah to illustrate that it is better to suffer for doing right than for doing wrong. Noah endured about a hundred years of mockery for building a boat in a land that never saw rain. But Noah faithfully continued to build the ark and preached righteousness. Peter explains the ark saving the righteous from the judgment of the flood symbolized how Jesus is our ark who saves us from God's judgment through His resurrection. Water baptism does not save anyone, but it is a symbol of your salvation if you have put your faith in Jesus.