If I regard iniquity in my heart, the Lord will not hear.
Does God hear the prayers of sinners? Yes and no.
Yes, our merciful God always loves us and works with us, and Jesus Christ even died for us “while we were still sinners” (Romans 5:8). We were all sinners (Romans 3:23), so if God did not hear our cries for forgiveness, there would be no human He would hear. After sinning, David prayed, “Hide Your face from my sins, and blot out all my iniquities” (Psalm 51:9). God heard that prayer.
But without repentance, as Isaiah wrote, “Your sins have hidden His face from you, so that He will not hear” (Isaiah 59:2).
Psalm 66:18 talks about sin “cherished” in the heart (New International Version). “If I have known it was there and encouraged it,” then God wouldn’t listen (Adam Clarke’s Commentary on Psalm 66:18).
To be assured God will hear and answer us, we must repent and work to root sin out of our heart with God’s help. See more about repentance in “How to Repent.”