We speak to God through prayer, and God speaks back to us. Through his word, and through His Holy Spirit. The book of Acts is the only book in the Bible that shows the Holy Spirit speaking, but it doesn’t show how. All it says is that the Spirit “says.”
How can we know when God is speaking to us through His Spirit? It takes wisdom and and understanding of scripture. One thing that is important to know is that God will never contradict himself. If you feel the Spirit is speaking and it is contrary to what scripture says, then it is not the voice of the Spirit!
I once heard it said that you can discern the voice of the Spirit from the voice of Satan because the voice of Satan tells you who you are and who you were. The voice of the Spirit tell you who you are and who God is making you to be. Do not listen to the voice of accusation, and focus on the soothing words of peace, assuring you of God’s unconditional love for you!