As David goes before God in his prayer, we see that he is coming from a righteous place and gives us a good blue print in how we should strive to live our own lives:
Psa 17:3 You have tested my thoughts and examined my heart in the night. You have scrutinized me and found nothing wrong. I am determined not to sin in what I say.
David is determined to present his case before God as if he had done nothing wrong, giving careful attention to the language YOU HAVE TESTED MY THOUGHTS AND EXAMINED MY HEART IN THE NIGHT, meaning that when no one else was around, David still had a pure heart.
As we learned previously, man likes to put on a front before others, but when the lights are off and no one is home, some of the most seemingly righteous people start to let their demons flare.
This was not the case with David though, David says; “Lord, you have seen me when no else has” and you know that I behaved – that’s actually a standard we should live for too; acting in obedience to God even when no one is around, which can be incredibly challenging in this day in age, but David understands that just because others might not see what we do or don’t do behind closed doors, God sees everything.