The core of Psalms 51 is address in verse 10...we have a holy God and an unclean human, what do we do? David models for us the solution, but will we submit to this sacrificial act of repentance.
Psalms 51:10 Create in me a clean heart, O God, and renew a right spirit within me.