After King David committed adultery with Bathsheba and planned the death of her husband, Uriah, he covered his sins by denying them and not confessing them. He probably went many months conducting business as usual, even performing religious duties. As long as David cloaked his sinful secrets, he experienced God's crushing finger of conviction and his strength evaporated like water in the heat of summer (Ps. 32:3-4).
When the prophet Nathan confronted David about his sin, God's conviction was so great that David confessed his sins to God and turned away from them. Immediately the Lord forgave David and he experienced His mercy and grace (2 Sam. 12:13; Ps. 32:5; Ps. 51).
Let's be careful not to hide our sin. When we uncover our sins by confessing them to God, we are covered with His forgiveness. - Marvin Williams