In 2 Samuel 12, God responds to David's evil deeds by sending Nathan to show him his sin and lead him to repentance. While God does forgive and there is hope for the future, nevertheless, Bathsheba's baby dies. For some bonus reading: check out our Psalm for this Sunday (Ps. 51), which is attributed to David as a response to this episode with Bathsheba.