“Come and hear, all ye that fear God, and I will declare what He hath done for my soul. I cried unto Him with my mouth, and He was extolled with my tongue. If I regard iniquity in my heart, the Lord will not hear me: but verily God hath heard me; He hath attended to the voice of my prayer.
Blessed be God, which hath not turned away my prayer, nor His mercy from me.” Psalm 66:16-20 (KJB)
The following is a quote from the Treasury of David, by C. H. Spurgeon on verse 18…
“If I regard iniquity in my heart.” If, having seen it to be there, I continue to gaze upon it without aversion; if I cherish it, have a side glance of love towards it, excuse it, and palliate it; “The Lord will not hear me.” How can he? Can I desire him to connive at my sin, and accept me while I wilfully, cling to any evil way? Nothing hinders prayer like iniquity harboured in the breast; as with Cain, so with us, sin lieth at the door, and blocks the passage. If thou listen to the devil, God will not listen to thee. If thou refusest to hear God’s commands, he will surely refuse to hear thy prayers. An imperfect petition God will hear for Christ’s sake, but not one which is wilfully mis-written by a traitor’s hand. For God to accept our devotions, while we are delighting in sin, would be to make himself the God of hypocrites, which is a fitter name for Satan than for the Holy One of Israel.” Treasury of David