Believers sometimes do not know if they have the Holy Spirit because they have never heard about him or taught about him. Before the arrival of the apostles, the Samaritan believers only received the message of Christ and the gospel of the kingdom that Philip taught them, but they did not know about the Holy Spirit.
Here are some of the ways you will know if you have the Holy Spirit:
You cannot walk by the Holy Spirit if you do not have him. Galatians
You can know that you have the Holy Spirit because you confess and know that Jesus is Lord. 1 Corinthians
You can know you have the Holy Spirit if he transforms you from glory to glory daily as you follow Jesus your Lord. 2 Corinthians
You can know you have the Holy Spirit if you witness Jesus to the world.