David knew the One who could thoroughly inspect and clean him was the only One who could find ALL his wicked ways- those we know as sin, AND those we don't. "Wash me completely from my iniquity, and cleanse me from my sin." (Ps. 51:2) This King over a nation often bowed down before a mighty God asking for mercy and grace with a broken and contrite heart (Ps. 51:17). He usually dealt with his sin before extensive damage, 'fire' or death to self. The best thing was David knew His God was able to deliver- and so we can know too!
Purge me with hyssop, and I shall be clean;
wash me, and I shall be whiter than snow.