God said these words about the people of Judah through Zechariah, in Zechariah 7 verse 13:
13 Therefore it happened, that just as He (the Spirit of God in His prophets) proclaimed and they would not hear, so they called out and I would not listen,” says the Lord of hosts.
In effect God said to His people, ” If you won’t listen to me, I won’t listen to you”. The same principle still stands today. If we don’t listen to God and obey Him, God does not listen to us, hear our prayers.
The goal of prayer is that it is God communicating to God. God’s Spirit in us communicating the will of God to the Father in heaven. If we don’t listen to God and wander away from Him, away from the influence of His Spirit, His Spirit cannot be the source of our prayers. God will not answer prayer that is not born of His Spirit because it won’t be according to His will and it is a mercy of God when He does not answer prayer that is not according to His will. We don’t want those prayers answered, it would harm us.
So it is with good reason God says, regarding prayer…..” If you won’t listen to me, I won’t listen to you” !