In 1 Samuel 12 the prophet Nathan confronts King David over his sins of adultery and murder. Up until that point, David was sure that these sins were hidden and behind him. But we have no "secret chambers" and God knows all things.
As Nathan confronts the King there are many critical lessons for us to learn. First is that getting what we want in life - economically, vocationally, etc. - can lead us to a place of spiritual lethargy. What we really need isn't worldly things, but Christ. Second, watch how David announces judgment - in God's name! - on the imaginary bad guy even while he's guilty of such horrific sin. This should caution us as to how dangerous pride and self-righteousness are even for the saved. Finally, God is merciful and forgives David's sin when the King repents and admits the obvious at last. Even still, there are grave consequences for these trespasses, which should caution even Christians against playing with fire, so to speak. Yes, the Lord is most merciful, but He's not mocked and there are often earthly consequences for sin as we see in this case. This should compel us to stay close to our disciplines so as to stay safe from temptation.