God: is closer when the way is clear….
Psalm 51:1-4 (KJV) “Have mercy upon me, O God, according to thy lovingkindness: according unto the multitude of thy tender mercies blot out my transgressions. Wash me throughly from mine iniquity, and cleanse me from my sin. For I acknowledge my transgressions: and my sin is ever before me. Against thee, thee only, have I sinned, and done this evil in thy sight: that thou mightest be justified when thou speakest, and be clear when thou judgest.”
The one thing which befalls every one of us is that we sin; it might not be deliberate, but situations creep up on us and there it is. The word goes into details about how sin is birthed in our hearts before it is manifested; however, we know it takes a process and we still get entrapped.
The good thing about our Heavenly Father is that He already placed a measure in place to assist us in overcoming and that is repentance through the blood of Jesus.
King David was subjected to failures in his walk as well, but he was quick to repent and seek repatriation with his Lord.
Let that be an example of searching the heart and removing the things which can easily have so caught up wrong behaviors.