If I regard iniquity in my heart, the Lord will not hear. But certainly God has heard me; He has attended to the voice of my prayer.
Psalm 66:18-19
Why are witnesses in a courtroom required to swear to tell “the whole truth” when they testify? So that what they say is true matches up with what they know to be true. If they are found to be lying—saying one thing but knowing another—they can be convicted of perjury and suffer serious penalties.
A judge and jury cannot see into a witness’ heart or mind to tell whether or not the truth is being presented. But God can. In the Old Testament, there were clear warnings about coming before God in prayer while hiding sin in one’s heart. That is, attempting to act holy in prayer while being unholy in practice. In such cases, God turns a deaf ear to the prayers (Proverbs 15:29; 28:9; Isaiah 1:15; 59:1-2). And the same is said in the New Testament (1 Peter 3:12). The first step in prayer is confession leading to cleansing.
When you pray, ask the Holy Spirit to reveal anything that would hinder your prayers.
Prayer will make a man cease from sin, or sin will entice a man to cease from prayer.