Passage
Then Joshua made them swear an oath at that time, saying, “Cursed before Yahweh is the man who rises up and builds this city Jericho; with the loss of his firstborn he shall lay its foundation, and with the loss of his youngest son he shall set up its gates.”
Nearby Context
Joshua 6:24 But they burned the city with fire, and all that was in it. Only the silver and gold, and articles of bronze and iron, they put into the treasury of the house of Yahweh.
Joshua 6:25 However, Rahab the harlot and her father’s household and all she had, Joshua preserved alive; and she has lived in the midst of Israel to this day, for she hid the messengers whom Joshua sent to spy out Jericho.
Joshua 6:26 Then Joshua made them swear an oath at that time, saying, “Cursed before Yahweh is the man who rises up and builds this city Jericho; with the loss of his firstborn he shall lay its foundation, and with the loss of his youngest son he shall set up its gates.”
Joshua 6:27 So Yahweh was with Joshua, and the report about him was in all the land.
Study Lenses
The verse centers on "joshua", "swear", "oath", "time", "saying", "cursed", "before", and "yahweh". It is saying that the verse draws attention to "joshua" and "swear", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 25's "However Rahab the harlot and her father..." into verse 27's "So Yahweh was with Joshua and the...", so "joshua" and "swear" belong inside that flow. In Joshua context, the local focus is covenant, worship, and faithfulness.
A plain takeaway is to answer the verse's own emphasis on "joshua" and "swear" with trust shaped by these words, not by a vague optimism outside the passage.