"And David said unto Nathan, I have sinned against the Lord. And Nathan said unto David, The Lord also hath put away thy sin; thou shalt not die." (2 Samuel 12:13)
A basic truth is expressed in this confession of David's: Every sin--not only the sin of blasphemy or of unbelief--is essentially a sin against the Lord and His nature of absolute righteousness.
This does not mean, of course, that sin hurts no one except God. In David's case, his sin resulted in the murder of a faithful soldier, Uriah; the implication of Bathsheba in David's adultery; and then the death of his infant son. It probably also contributed to the subsequent sins of two other sons of David, Amnon and Absalom. Furthermore, as Nathan said, it had "given great occasion to the enemies of the LORD to blaspheme" (v. 14).
Nevertheless, it was, above all else, a sin against God. God had chosen David as king and had blessed him abundantly, yet David was not content and elected to make his own decisions in rebellion against the will of God and the Word of God. But when he was made to realize, by Nathan, what he had done, he immediately repented of his sin, and thereby received forgiveness.
God, in His grace, has made a wonderful provision for forgiveness and restoration, because "the blood of Jesus Christ his Son cleanseth us from all sin." Therefore, "if we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness" (1 John 1:7, 9).
Confession must be specific and sincere, of course, not general and superficial to be effective. But if this is done, then we can exclaim joyfully with David: "Blessed is he whose transgression is forgiven, whose sin is covered," because he first, as he said, "acknowledged my sin unto thee, and mine iniquity have I not hid" (Psalm 32:1, 5). HMM