“Humility is a rare Christian grace of great price in the courts of heaven, and it is necessary for effective prayer.” – Unknown
Prayer is effective when done with a pure heart. The issue many of us fall into is praying with pride lingering within our hearts. When this happens, we risk God not listening to our prayer, or receiving an answer to our prayer along with unintended consequences.
It's not easy for us to discern pride in our hearts since it can be so personal, prevalent, and even familiar. To remedy this, we can invite the Holy Spirit to search our hearts, to illuminate the Word of God, and convict us of any sin (pride included) that gets in between our hearts and God. This positions our hearts to be instructed and informed by God of anything that is not pleasing to Him.
A prayer of David’s that we can pray is:
“Search me, O God, and know my heart; test me and know my anxious thoughts. See if there is any offensive way in me, and lead me in the way everlasting.” – Psalm 139:23-24
When we invite God to search our hearts, listen for His answer, and agree with God’s assessment, we’re able to present our praises and requests to God with clean hearts.
"God opposes the proud but gives grace to the humble. Humble yourselves, therefore, under God's mighty hand, that he may lift you up in due time.” – 1 Peter 5:5-6
A useful resource for searching one’s heart for elements of pride or other sin is: