David is one of Jesse the Bethlahemite’s sons. He is a shepard just like Moshe was and he will be the next king of Israel. We know he will be strong and a good fighter because he had the same name as Esau who was a both of those traits.
When Shaul was kicked out of his king position, the spirit of Hashem departed from him and that space was filled with a "bad spirit" which was actually depression. The only cure for his depression was for David the new king to play the lyre for him.
The battle of the Plishtim was set up unconventionally. They were on two different mountains with a valley between them. This meant that could not win because they could not hit each other from their mountain sides.
David suggested that he should be the one that would fight Goliat the very large warrior who would settle the battle for once. Shaul said he shouldn’t fight Goliath because David was only a boy, and Goliath had been a warrior from his youth. He doesn’t have enough experience and he is too young and not the right guy to fight this warrior.
David convinced Shaul by saying since he had God on his side and that he was strong that he would be able to win the fight against Goliath. David and Goliat then were trash talking each other and David was going to go into battle fully equipped but he went into battle with only a stick, a stone, and a sling.
David finally defeated Goliat by knocking him out with his stone and the he took Goliat's sword and stabbed it in Goliat's throat. Shaul walked over and did not recognize David probably because he either physically changed or didn't think he could defeat Goliat.