In Psalms, chapter sixty-six, verse eighteen, those who take pleasure in unrighteousness have no hope of answered prayer when they call on God. God wants us separated from sin. Only then will He respond to us as a Father to a son, as in Second Corinthians six, verses fourteen through eighteen.
God refuses to answer the prayers of those who selfishly are ambitious, love pleasure, and desire honor, power, or riches, as in James four, verse one. We should note that God will not listen to our prayers if our hearts have selfish desires. Scripture tells us God hears only the prayers of the righteous, as in Psalms thirty-four, verses thirteen through fifteen, and Psalms sixty-six, verse nineteen, of those who call upon Him in truth, as in Psalms one hundred and forty-five, verse eighteen, of the genuinely repentant and humble, as in Luke eighteen, verse fourteen, and of those who ask according to His will, as in First John five, verse fourteen.
Why are some prayers answered and others not? John declares that the prayer life is relative to our devotion to God. Obeying, loving, and pleasing God, as in John eight, verse twenty-nine, and Second Corinthians five, verse nine, then Ephesians five, verse ten, and Hebrews thirteen, verse twenty-one, are indispensable conditions to receive what we ask for in prayer, as in Psalms fifty, verses fourteen through fifteen, Proverbs fifteen, verse twenty-nine, Isaiah fifty-nine, verses one through two, Matthew six, verse fifteen, Mark eleven, verse twenty-five, and James five, verse sixteen, accordingly.
The theme verse under God’s Power and Works section describes that if sin is in the heart, God cannot work for the one praying to Him. On the other hand, those believers who have clean hearts before God will receive an answer to their prayers accordingly.