You could do it like the Book of Numbers, chapter 14, in which the Moses and the Children of Israel are punished by God for not believing. He sentences them to wander the desert for 40 years, long enough for the older generation to die, and the new generation to rediscover their faith. (Notably, Moses is mentioned in the Quran more than any other individual, and in ways that often mirror the prophet Mohammed.)
You could do it like they do in Psalm 107:4
Some wandered in desert wastelands,
finding no way to a city where they could settle.
They were hungry and thirsty,
and their lives ebbed away.
Then they cried out to the Lord in their trouble,
and he delivered them from their distress.
He led them by a straight way
to a city where they could settle.
Let them give thanks to the Lord for his unfailing love
and his wonderful deeds for mankind,
for he satisfies the thirsty
and fills the hungry with good things.