3 You have tested my heart; You have visited me in the night; You have tried me and have found nothing; I have purposed that my mouth shall not transgress. 4 Concerning the works of men, by the word of Your lips, I have kept away from the paths of the destroyer. 5 Uphold my steps in Your paths, that my footsteps may not slip. (Psalm 17:3–5, NKJV)
David resisted sin when he had the purpose of heart not to sin by his words, and by carefully avoiding the sinful works of men. Our faith ought to compel us to also purpose in our hearts not to speak evil, and, to keep away from the path of sin. David’s purpose of heart not to speak sin also led him to obey God’s word (“the word of Your lips”) in order to keep away from those who would bring destruction into his life. And so, with purpose of heart, being guided by God’s word, David was sure that God would uphold his steps and keep him from slipping into sin. When David sinned, it was precisely because his purpose faltered and his trust in God’s word failed. That is what happens when we sin, too. When God examines your heart, may he see your resolve to speak what is right, and to do His words. If so, you will be walking upon the solid ground of faith.