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 resist sin going forward. David's story shows both the possibility of forgiveness for even grave sins, as well as the consequences of sin despite repentance.