Achan dies for stealing devoted things
God told Joshua the defeat at Ai happened because devoted things were taken from Jericho. The next day the Israelites found it was Achan, and they stoned him.
Key passages
Jos 7:1

But the Israelites broke faith concerning the devoted things. Achan son of Carmi son of Zabdi son of Zerah, of the tribe of Judah, took from the devoted things; and Yahweh’s anger was kindled against the Israelites.

Jos 7:10–26

And Yahweh said to Joshua, “Stand up! Why have you fallen on your face? Israel has sinned and transgressed my covenant that I commanded them. They have taken from the devoted things; they have stolen and acted deceitfully, and they have put them among their belongings. The …

See also
Jos 22:20; 1 Ch 2:7;