“Yahweh said to Joshua. ‘Stand up! Why have you fallen upon your face? Israel has sinned. They have transgressed my covenant that I imposed on them. They have taken some of the devoted things. They have stolen them. They have acted deceitfully. They have put them among their own belongings. Therefore the Israelites are unable to stand before their enemies. They turn their backs to their enemies, because they have become a thing devoted to destruction themselves. I will be with you no more, unless you destroy the devoted things from among you.”
You disobey, you lose. Yahweh says that Israel has sinned. They stole some of the devoted things of the enemies. They put those things with their own belongings. They are doomed to destruction themselves. The devoted things must be destroyed. So far, there is no mention of what these things are.
“Proceed to sanctify the people. ‘Sanctify yourselves for tomorrow!’ Thus says Yahweh, God of Israel. ‘There are devoted things among you, O Israel. You will be unable to stand before your enemies, until you take away the devoted things from among you.’ In the morning therefore you shall come forward tribe by tribe. The tribe that Yahweh takes shall come by clans. The clans that Yahweh takes shall come by households. The household that Yahweh takes shall come one by one. The one who is taken as having the devoted things shall be burned with fire, together with all that he has, for having transgressed the covenant of Yahweh, and for having done an outrageous shameful thing in Israel.’”
You have to get rid of the evil in your midst. All the tribes will come forward. Yahweh will know the guilty ones. After the tribes come, he will pick one tribe, then one clan, then one household, and finally one individual. Whoever took the devoted items from Jericho will die by fire for the outrageous shameful thing that they have done.