The Israelites didn’t have to wander 40 years if they would have obeyed God and went into the Land at Kadesh Barnea. It was God’s plan though to test, teach, and provide for them. Their clothes and sandals didn’t wear out along with sustenance of Manna, quail, and water. Israel learned that God was able to take care of them even in the most barren of places.
Here is a picture of the Negev Mountains near Eilat, Israel.