Then David confessed to Nathan, "I have sinned against the Lord." (2 Samuel 12:13)(NLT)
By law and by his own verdict, David should have died for committing adultery with Bathsheba and arranging Uriah's death. But David was truly sorry for what he had done and wrote Psalm 51 to express his feelings. That psalm reflects both David's penitent spirit and his hope that the Lord would forgive him. God did forgive David and did not hold this sin against him, although there were consequences to his actions that did take place. God offers forgiveness to people today as well. Let us praise God that he does not hold our sins against us if we repent.
MERCIFUL FATHER, we praise you for your compassion. We thank you for seeing our misery and providing a way our of our sinfulness. Convict us by your Spirit when we sin against you, and cause us to look to you for mercy. We ask this knowing that we will find forgiveness in the sacrifice of your Son, Jesus Chirst. Amen.
(from the Praise and Worship Study Bible from Tyndale House Publishers)