David committed adultery with Bathsheba and arranged for her husband Uriah to be killed. He tried to conceal his sins but was confronted by Nathan. David repented and confessed his sins. Though forgiven, David still faced consequences for his actions, including the death of his child with Bathsheba. However, through repentance, David was able to find joy in God's salvation again. True repentance requires a changed heart and relying on God rather than oneself to avoid future sins. David's story shows that no matter how serious the sin, God is willing to forgive those who repent.