Yahweh is so merciful towards His people. You see when David and Bathsheba committed adultery and sinned against Yahweh He still gave them another chance. David had intercourse with Bathsheba and they had a son but Bathsheba was Uriah’s wife. Uriah was an officer that worked in David’s army. David seen Bathsheba taking a shower one day and just wanted her and that is how the sin started. In return David set up Uriah to get killed in battle so that He can marry Bathsheba. Later on their son got sick and died. David mourned and fasted for the boy but after the boy died David got up and got himself together and went to worship Yahweh. David did this because he knew he had sinned and needed to repent.
Although Yahweh was displeased He still gave them another chance and blessed them with another son who would later become king. “Then David comforted his wife Bathsheba, and he went to her and made love to her. She gave birth to a son, and they named him Solomon. The Lord loved him;” (2 Samuel 12:24 NIV) As you can see we have a merciful and amazing father. It’s not okay to sin and He really does not like it. However, when you come to the end of yourself and you realize what you have done and repent He will always come to the rescue. When you come to Him with a repentant heart He takes pity on you because instead of continuing to sin, you chose to be genuinely sorry for displeasing Him.