In Joshua 7 of the Bible, Joshua ambitiously tries to capture the city of Ai, but the effort is overwhelmingly defeated. Joshua had failed to inquire of God first, and had he done so he would have been spared much trouble. The problem was that one Israelite, Achan, had stolen the forbidden loot of Jericho and put the whole nation in danger.
Here is my Joshua 7 Bible Study (in PDF). Feel free to use it. It includes the passage from the ESV, although there are some expressions that I have changed for the sake of maintaining consistency with the Hebrew that it was originally written in.
God bless, Pastor Haydn.