Satan uses our hidden desires as the basis to plant his suggestions and reasonings in our minds and make us think that they are our own ideas. Our "double-minds" or secret longings, also make our prayers for deliverance ineffective. "But let him ask in faith, nothing wavering, for he that wavereth is like a wave of the sea driven with the wind and tossed. For let not that man think that he shall receive any thing from the Lord. A double-minded man is unstable in all his ways" (James 1:6-8).
It is not easy to purify our hearts, because "The heart is deceitful above all things, and desperately wicked" who can know it?" (Jere. 17:9). For this reason, we should spend time before the Lord and ask Him to search our hearts.
Our heart attitude in the presence of the Lord will tell him how sincere we are in purifying our double-mindedness. This is why He instructs us to "Be afflicted, and mourn, and weep: let your laughter be turned to mourning, and your joy to heaviness. Humble yourselves in the sight of the Lord, and he shall lift you up" (James 4:9-10).
If we are sincere, the Holy Spirit will reveal the secret desires of our heart which Satan is using as the basis for our temptations. These desires will be related to our love of the things of this world. "Ye adulterers and aduteresses, know ye not that the friendship of the world is enmity with God? Whosoever therefore will be a friend of the world is the enemy of God..." (James 4:4-5)
When the Holy Spirit reveals our hidden motives, God will give us the grace (desire and power) to purify our hearts as we humble ourselves. "But he giveth more grace. Wherefore he saith, God resisteth the proud, but giveth unto the humble" (James 4:6).