The words save yourselves from this sinful generation are impossible without first acknowledging your sin and coming to Christ for forgiveness. It is not a salvation of works, but it was the name of Jesus who Peter accused them of crucifying. They had rejected the very person who provided salvation for their sin. Until the Spirit comes to us and removes our blinders and convicts us of our sin, and we accept the atoning work of Christ for us, we cannot be saved.
Then they gladly received his word and followed in baptism. To receive Christ and not follow through with the testimony of baptism to faith in Christ, leads to an ineffective Christian life. I have never heard of someone who refused to be baptized follow Christ with a heart sold out to Him. One might say our baptism is like a wedding band, as it pictures our relationship to Christ. Baptism never brings salvation. It should be the natural outflow of our salvation by wanting to identify with Christ because of all He has done for us.
Next they continued steadfastly and wonderful things happened in the remaining verses of this chapter. It's been 59 years since I believed and was baptized. Since that time, I've continued, hopefully steadfastly preaching for about 57 plus years about the Lord Jesus who I love. Is that your life? Or is it mediocre? .