King Jehoshaphat was the 5th King after King David.
Jehoshaphat sought the Lord and walked in the ways of God's commandments. Jehoshaphat took delight in the ways of the Lord and removed the idols out of Judah. He also sent out Levites to teach the people the Bible.
Jehoshaphat did make the mistake of joining forces with wicked King Ahab in going to war against the people of Ramoth Gilead. The prophet Micaiah warned them not to go. King Ahab died in the war and Jehoshaphat came close to being killed. The prophet Jehu rebuked him for his mistake.
Sometime after this more than three nations came to attack Jehoshaphat at one time. Jehoshaphat set himself to seek the Lord and he called for a fast throughout all the kingdom. When everyone was gathered together Jehoshaphat prayed "O Lord God of our fathers, are You not God in heaven, and in Your hand is there not power and might, so that no one is able to withstand You? We have no power against this great multitude, nor do we know what to do, but our eyes are upon You." Then the spirit of the Lord came upon Jahaziel and he said, "listen, thus says the Lord to you: 'do not be afraid nor dismayed because of this great multitude, for the battle is not yours but God's, you will not need to fight in this battle. Position yourselves, stand still and see the salvation of the Lord.”
Jehoshaphat and all the people bowed down and worshipped the Lord. Then the Levites got up and praised the Lord God with loud voices. Early the next morning they rose up and Jehoshaphat said to the people "believe in the Lord your God, and you shall be established; believe His prophets and you shall prosper." Then Jehoshaphat sent the choir out before the army singing "Praise the Lord for His mercy endures forever."
As the people went out to war singing and praising the Lord, God sent confusion among their enemies so that they started killing each other. By the time God's people came to the place of battle they found all their enemies lying dead before them, not one had escaped.
If we learn to praise the Lord during difficult times Hd will see us through them all.