Peter has just exhorted us to "live sacrificially" so that no one can slander us based on our actions. Now to the perfect example, Christ (v. 18) says "For Christ died for sins once for all, the righteous for the unrighteous, to bring you to God." Christ was focused He knew what He was to do and went for it. He did so for our good and for no other reason, His love for us drove Him to die for us. He is our perfect example and we are powered by the same spirit.
This next section puzzled / puzzles me… I read up a little on it and it seems to make sense within the context of the chapter so I will put this idea forth. Skipping ahead to verse 20 and the man Noah. Perhaps you feel like comparing yourself to Jesus is setting yourself up for failure, how can you compare to perfection. If that is your attitude Peter gives you a second chance. Noah, another man who stood up against intense persecution and mockery. I mean think of the mockery… the guy was building a HUGE boat and did not live near water… It would have been easy to get discouraged and turn away from the very clear calling God put on his life. But Noah, powered by the spirit given by God endured and survived and was brought through the water.
Just as baptism in Noah's sense was a sort of "washing" away of the past life along with the sinful way the world had gone. So baptism "saves" us in that it is a declaration of the washing away of the sinful way we have gone. Not that baptism alone saves… that is not scriptural. Christ saves, baptism for us as it was for the early Christians was a public commitment that we have died to our sins, rose again in the newness of Christ and our lives will never be the same and "will give us "good conscience toward God" (v. 21).
That is the nearest I can understand thus far, please interject if you feel I am in error on any part.
Basically this is what I get from it. We are called to endure persecution, stay focused on God's will for us. Christ did it, Noah did it, Paul and the apostles did it. The same spirit that strengthened them is in us. So now we can do it, thanks be to God.