David was a humble shepherd boy and the Lord sent Samuel to the house of Jesse to find a king. He was the youngest of Jesse's sons. Samuel was told not to look on his stature but on his heart. David as a shepherd during Israel's great battles with the Philistines went and challenged Goliath who was nearly 10 feet tall. No one else challenged him; but David, with 5 stones and a sling, slew him.
When he was anointed to be heir apparent Saul became very jealous and many times tried to murder him. Yet David was always loyal to him and said he would not lift his arm against the Lord's anointed. On some occasions he did call David in to play the harp for him and his evil spirit was quenched. However, that was temporary.
In spite of Saul's animosity toward David, Saul's son, Jonathan, became a great friend. And even said David had right to be king and not Jonathan. Saul and three of his son's were slain in battle.
When that happened, two of the tribes were under the rule of a son of Saul, while David became king of the other 10 tribes. Eventually all of the tribes were united under David's rule. David was able to end many of the war's with the philistines as a king and was a prophet king. He married many women given to him by the lords servant Nathan and other prophets.
However in spite of his triumph Tragedy struck his own personal life. His nephew, Joab was a commander of the armies. There was a time when the king's were to go to battle. Yet David tarried and sent his nephew instead. While there he was walking on his rooftop at night a common practice in Old Testament times as the architecture was made so people could easily converse from rooftops.
While there he noticed Bathsheba bathing and inquired after her. Someone said, "Is not this Bathsheba, wife of Uriah the Hittite?" So David summoned her and as a result of sexual sins she became pregnant. Uriah was out to battle.
When the soldiers returned home David asked that Uriah go to his own home to cover his sin: by Uriah going home he would think the child was his. However Uriah did not do that felt it was unfair to the other soldiers that they sleep at the doorstep while he goes home.
Frustrated in his attempt he sent by his nephew Joab a letter saying send Uriah to the hottest battle front that he may die. Uriah and many other men died in that battle.
After Bathsheba's mourning was passed David married her but the thing he done displeased the Lord. The Lord sent Nathan the prophet to his house which means he did not immediately seek repentance but someone had to be sent.
Nathan told him a parable about a poor man that had one sheep and rich man had many but stole poor man's sheep and ate it at a feast. David still not recognizing the seriousness of sin said that the rich man should be put to death because he had no pity. His conscience came hammering down on him when Nathan said, "Thou art the man," meaning that David was the rich man of the parable, and would be punished accordingly.
The child conceived through the affair died. After David's misdeed, tragedy befell his house as many of his children committed murder and incest. To each other and were jealous over who should sit on the throne. Bathsheba had other children after the marriage and their son Solomon became the king.
He made one foolish decision after another as well. He fell deeper into apostasy when he put several of Saul's grandchildren to death for something their grandfather did that was prohibited by Israelite law as well, and had a hard time making other decisions as numbering Israel in certain battles and making unwise favoritism of some of his children.
There were sincere efforts at repentance; however, for those who have once had the light of Christ, murder is an unforgivable sin and he was not able to repent of that.
He wrote many psalms of praise, thanksgiving and repentance. Many are quoted at Protestant funerals and talked about in LDS manuals. Some were sincere attempts at forgiveness to which he was not able to attain in this life.
Peter said his body was still in the tomb when other Saints of ancient days were resurrected. Section 132 of the Doctrine and Covenants says in no things has he sinned save the case of Uriah and his wife and has fallen from his exaltation.
The Bible Dictionary says that he will be resurrected at end of millennium and that his life is a perfect example of why one must endure to the end.
Mark E. Peterson in book called Three Kings makes mention of the good and bad of his life. Spencer W. Kimball in Miracle of Forgiveness talks repeatedly about him. And in the April 1995 General Conference, Elder Neal A. Maxwell asked who David dealt the greatest blow to; Goliath, Uriah, or himself.
David's life is a great example of both triumph and tragedy.