David is described as a man after God's own heart. He was not perfect by any means, but there was something in him that attracted God. It was his heart. David had a contrite and humble heart.
The Bible tells us that God will not despise a contrite heart. David had just committed adultery when he wrote this psalm, and this psalm instructs us how to confess our sins. First John 1:9 says, "If we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness" (KJV). read more