Thousands were in Jerusalem for this festival. When the Spirit of God was given to the disciples that morning, Peter then preached the first inspired sermon for the Christian church. Thousands were convicted in their hearts, having realized the fruitlessness of their past lives and realizing that Christ was and is the Savior.
Peter spelled out, in no uncertain terms, that there are two conditions. Those two conditions are the same that Jesus spelled out at the beginning of His Gospel—repent and believe. No one can be rightly baptized unless he believes.
Once these conditions are complied with, God stands bound by a promise to put within the repentant believer His Spirit. Then, many of His attributes begin to be imparted to us. His love, faith, understanding, goodness, and power—the power to develop the very same things that make up who He is and how He thinks and acts begin to be made available to those who God calls and gives His Spirit of a sound mind to.
This is the beginning of eternal life, and the very character of God. The Holy Spirit in a person changes that person. If there is no change in the person after baptism and the receipt of the Holy Spirit, then that person was most likely just dunked.
You do not join a church. God calls you into His church. Water baptism is required for those God calls to begin the process of conversion and salvation.
In the first inspired sermon, after the Holy Spirit came to convert Peter and the apostles, Peter commanded all to repent, and to be baptized.
The command is, "Repent, and be baptized"—and then, "you shall receive the gift of the Holy Spirit."
Let us jump down to verse 36. This section that we just read is Peter pointing the finger at them and saying, "Look, God raised Jesus up to preach a message, to do these signs before you so you would know who He was, and you turned around and killed Him. But that did not stop God because God raised Him up. And now He abides in heaven at the throne of God."
They just killed their God. Can you imagine the feelings of guilt they felt? They had been out there in the crowd saying, "Barabbas, Barabbas! Crucify Him, crucify Him!" And now Peter turns all that back on them. You guys sinned. It was not just any sin; it was Deicide. Could you imagine?! They had killed their Savior. They had killed their Messiah, their God and King, whom they thought they worshipped, you know, throughout the Old Testament period. But it came down to them when He appeared, and they killed Him. So their question obviously is logical here. What can we do about this? Is there a way for this to be fixed? What does that mean for us? Are we doomed to death? And luckily (luckily is not the word) Peter had an answer, a good answer, a biblical answer, an answer from God.