In Acts 2:36, Peter set the stage for this week's study as he stated that "God has made him both Lord and Christ, this Jesus whom you crucified." The nation of Israel had waited for over 1,000 years for their Messiah and Peter tells them that not recognizing Him, they crucified and killed the object of their desire.
In verse 37, those hearing Peter were cut to the heart as the Holy Spirit convicted them of their sin. Without the Holy Spirit, they would not have understood the scriptures spoken by Peter. The Holy Spirit convicted them of their sins for which Jesus was crucified and died. They were not convicted because they had crucified Christ, but rather because Christ had to be crucified (per the scriptures) for their sins. As a result, they were "cut" or "pierced" to the heart. Thousands were brought to the obedience of faith. However, neither Peter's words, nor the miracle they witnessed, could have produced such effects, had not the Holy Spirit been given. Sinners, when their eyes are opened, cannot but be pricked to the heart for sin, cannot but feel an inward uneasiness. Peter exhorted them to repent of their sins, and openly to avow their belief in Jesus as the Messiah, by being baptized in his name. Thus professing their faith in Him, they would receive remission of their sins, and partake of the gifts and graces of the Holy Spirit.
These listeners were not initially indwelt by the Holy Spirit but they were convicted. In John 16:7-11, Jesus said that his leaving would cause the Holy Spirit to come and he would convict people of their sin and cause them to repent and see Jesus for who he is. Until we look inside ourselves and see our sin, the gospel message is meaningless and the Holy Spirit cannot work in our heart to have us accept Jesus as our Lord and Savior. Through the Holy Spirit and the piercing, we (1)recognize our sin (2)see Jesus died for me personally (3)accept God's gift of grace (4)repent and turn away from our sin and (5)and baptism of the Spirit happens as our salvation experience. From that point on, we are indwelt by the Holy Spirit.
The emphasis is not on the technique of baptism. It is on repenting and turning away and then water baptism demonstrates that we are to be identified as a follower of Christ. To be identified means we are no longer a follower of the world's ways but are a follower of Christ seeking to become like Him. In 2 Peter 3:8, Peter says that God's desire is for all to come to repentance and be saved. Then as Peter did, we are to share God's good news in truth and love.