The Word of God tells us that we must repent and be baptized in the name of Jesus Christ for the remissions of sins. Then you will receive the gift of the Holy Spirit. God loves his children. It is the will of God that all of his children come to repentance and be baptized but they won't due to stubbornness, rebelliousness, and too self-willed.
Acts 2:38
38 Then Peter said unto them, Repent, and be baptized every one of you in the name of Jesus Christ for the remission of sins, and ye shall receive the gift of the Holy Spirit.
How did the apostles receive the Holy Spirit at Pentecost?
Matthew 28:18-20
18 And Jesus came and spoke unto them, saying, all power is given unto me in heaven and in earth.
19 Go ye therefore, and teach all nations, baptizing them in the name of the Father, and of the Son, and of the Holy Spirit:
20 Teaching them to observe all things whatsoever I have commanded you: and, lo, I am with you always, even unto the end of the world. Amen.
The Holy Spirit descended upon the apostles at Pentecost. They taught the doctrine of Jesus Christ.
Acts 1:8,22
8 But ye shall receive power, after that the Holy Spirit is come upon you: and ye shall be witnesses unto me both in Jerusalem, and in all Judaea, and in Samaria, and unto the uttermost part of the earth.
22 Beginning from the baptism of John, unto that same day that he was taken up from us, must one be ordained to be a witness with us of his resurrection.
Acts 2:1-4
1 And when the day of Pentecost was fully come, they were all with one accord in one place.
2 And suddenly there came a sound from heaven as of a rushing mighty wind, and it filled all the house where they were sitting.
3 And there appeared unto them cloven tongues like as of fire, and it sat upon each of them.
4 And they were all filled with the Holy Spirit, and began to speak with other tongues, as the Spirit gave them utterance.
Acts 19:5-6
5 When they heard this, they were baptized in the name of the Lord Jesus.
6 And when Paul had laid his hands upon them, the Holy Spirit came on them; and they spoke with tongues and prophesied.
2 John 1:9
9 Whosoever transgresseth, and abideth not in the doctrine of Christ, hath not God. He that abideth in the doctrine of Christ, he hath both the Father and the Son.