Jehoshaphat would seek answers from God before going into battle. When the enemy was coming to battle with Jehoshaphat, God told him that he would not need to fight because God would fight for him. Jehoshaphat gathered all the people and instead of fighting the enemy, the people began to praise God.
From the Bible:
2 Chronicles 20:2-25
‘Jehoshaphat was afraid and turned his attention to seek the Lord ; and he proclaimed a period of fasting throughout Judah. Then some came and reported to Jehoshaphat, saying, “A great multitude is coming against you from beyond the sea, from Aram; and behold, they are in Hazazon-tamar (that is Engedi).” So Judah gathered together to seek help from the L ord ; they even came from all the cities of Judah to seek the L ord . Then Jehoshaphat stood in the assembly of Judah and Jerusalem, in the house of the L ord in front of the new courtyard; and he said, “L ord , God of our fathers, are You not God in the heavens? And are You not ruler over all the kingdoms of the nations? Power and might are in Your hand so that no one can stand against You. Did You not, our God, drive out the inhabitants of this land from Your people Israel, and give it to the descendants of Your friend Abraham forever? They have lived in it, and have built You a sanctuary in it for Your name, saying, ‘If disaster comes upon us, the sword, or judgment, or plague, or famine, we will stand before this house and before You (for Your name is in this house), and cry out to You in our distress, and You will hear and save us. ’ Now behold, the sons of Ammon, Moab, and Mount Seir, whom You did not allow Israel to invade when they came out of the land of Egypt (for they turned aside from them and did not destroy them), see how they are rewarding us by coming to drive us out from Your possession which You have given us as an inheritance. Our God, will You not judge them? For we are powerless before this great multitude that is coming against us; nor do we know what to do, but our eyes are on You.” All Judah was standing before the L ord , with their infants, their wives, and their children. Then in the midst of the assembly the Spirit of the L ord came upon Jahaziel the son of Zechariah, the son of Benaiah, the son of Jeiel, the son of Mattaniah, the Levite of the sons of Asaph; and he said, “Listen, all you of Judah and the inhabitants of Jerusalem, and King Jehoshaphat: This is what the L ord says to you: ‘Do not fear or be dismayed because of this great multitude, for the battle is not yours but God’s. Tomorrow, go down against them. Behold, they will come up by the ascent of Ziz, and you will find them at the end of the valley in front of the wilderness of Jeruel. You need not fight in this battle; take your position, stand and watch the salvation of the L ord in your behalf, Judah and Jerusalem.’ Do not fear or be dismayed; tomorrow, go out to face them, for the L ord is with you.” Jehoshaphat bowed his head with his face to the ground, and all Judah and the inhabitants of Jerusalem fell down before the L ord , worshiping the L ord . The Levites, from the sons of the Kohathites and from the sons of the Korahites, stood up to praise the L ord God of Israel, with a very loud voice. They rose early in the morning and went out to the wilderness of Tekoa; and when they went out, Jehoshaphat stood and said, “Listen to me, Judah and inhabitants of Jerusalem: Put your trust in the L ord your God and you will endure. Put your trust in His prophets, and succeed.” When he had consulted with the people, he appointed those who sang to the L ord and those who praised Him in holy attire, as they went out before the army and said, “Give thanks to the L ord , for His faithfulness is everlasting.” When they began singing and praising, the L ord set ambushes against the sons of Ammon, Moab, and Mount Seir, who had come against Judah; so they were struck down. For the sons of Ammon and Moab rose up against the inhabitants of Mount Seir, completely destroying them; and when they had finished with the inhabitants of Seir, they helped to destroy one another. When Judah came to the watchtower of the wilderness, they turned toward the multitude, and behold, they were corpses lying on the ground, and there was no survivor. When Jehoshaphat and his people came to take their spoils, they found much among them, including goods, garments, and valuable things which they took for themselves, more than they could carry. And they were taking the spoils for three days because there was so much. ‘
2 Chronicles 20:2-25