I've heard it said often enough when God has not answered someone's prayers, "I guess God's not hearing me."
Certainly, there are reasons God does not hear us. Unrepented sin tops the list. For example, "If I regard wickedness in my heart, the Lord will not hear" (Psalm 66), or "But your iniquities have made a separation between you and your God, and your sins have hidden His face from you so that He does not hear" (Isaiah 59), or "You husbands . . . show [your wives] honor as a fellow heir of the grace of life, so that your prayers will not be hindered" (1 Peter 3).
But, sin aside, it could be that God has heard our prayer, but has simply said, "Not yet."
Or even, "No."
What we want to assiduously avoid is to use prayer -- even unconsciously -- to try to manipulate God into doing our will.