The people in Jericho knew that the Hebrews were close by, so they shut up the city and prepared for a siege.
In the meantime, God told Joshua that the Hebrew army should march silently around Jericho, lead by priests carrying the Ark of the Covenant and blowing trumpets, every day for six days, and then on the seventh day, the march around the city seven times, and then at the end of the last circumnavigation, to have the priests blow long and hard on the trumpet and everyone yell at the same time. (Why this wasn’t considered a violation of the Sabbath and thereby a stoneable offense isn’t explained.)
So Joshua told the officers the plans, and the officers explained it to their men, and the Hebrews started their daily march around Jericho. You can imagine how bad this psyched out the people inside, to have this huge silent army marching around the city.
On the seventh day, the Hebrews marched around seven times, and then at the end of the seventh time, the priests started blowing on their rams’ horn trumpets as long as they could and everybody started yelling at the top of their lungs, and lo! the city walls collapsed!
Joshua told the soldiers to invade the city and to kill every living thing, except Rahab and her family (who somehow weren’t killed by the collapse of the city wall in which her house apparently was?), and to burn all portable goods, altars, idols, etc,, but to collect all the gold, silver, and bronze and give it to the priests.
So the slaughter and burning commenced, but the spies went and found Rahab and her family and escorted them safely back to the Hebrew camp.
After all the people and animals were killed and the gold, silver and bronze was ferreted out, Joshua commanded that the city be burned and then laid a curse on any person who would ever dare rebuild it.