The Spirit of God searches our hearts in a way that we cannot—He knows us better than we know ourselves. The prayer of the psalmist here implies that he wants to know more of himself; he wants a greater understanding of his sinful tendencies in order that he might be holy and pure. But the prayer also implies that the psalmist is ready to listen to what God the Holy Spirit shows him.
When the Spirit reveals our sin we ought not to “quench not the Spirit” (1 Thessalonians 5:19). To do this is to extinguish His revelation. It is to disregard the voice of holy reason for the voice of unholy desire! As the Spirit reveals the sins of your heart, you are to act upon that. Your response ought to be like David’s when his sin was revealed: “Wash me throughly from mine iniquity, and … from my sin.… Against thee, thee only have I sinned” (Psalm 51:2–4).