David pleaded with God for the child. He fasted and went into his house and spent the nights lying1 on the ground.
References for 2 Samuel 12:16
The elders of his household stood beside him to get him up from the ground, but he refused,2 and he would not eat any food with them.3
References for 2 Samuel 12:17
On the seventh day the child died. David's servants were afraid to tell him that the child was dead, for they thought, "While the child was still living, we spoke to David but he would not listen to us. How can we tell him the child is dead? He may do something desperate."
David noticed that his servants were whispering among themselves and he realized the child was dead. "Is the child dead?" he asked. "Yes," they replied, "he is dead."
Then David got up from the ground. After he had washed,4 put on lotions and changed his clothes,5 he went into the house of the LORD and worshiped. Then he went to his own house, and at his request they served him food, and he ate.
References for 2 Samuel 12:20
His servants asked him, "Why are you acting this way? While the child was alive, you fasted and wept,6 but now that the child is dead, you get up and eat!"
References for 2 Samuel 12:21
He answered, "While the child was still alive, I fasted and wept. I thought, 'Who knows?7 The LORD may be gracious to me and let the child live.'8
References for 2 Samuel 12:22
But now that he is dead, why should I fast? Can I bring him back again? I will go to him,9 but he will not return to me."10
References for 2 Samuel 12:23