Deuteronomy 1:2-3 Normally it takes only eleven days to travel from Mount Sinai to Kadesh-barnea, going by way of Mount Seir. But forty years after the Israelites left Egypt, on the first day of the eleventh month, Moses addressed the people of Israel, telling them everything the Lord had commanded him to say.
The reason for the detour was the Israelites’ initial fear of invading Canaan in response to reports from scouts, who, we now learn, were sent ahead at the request of the Israelites. And it wasn’t just a one-off act: the Israelites had shown their fear and disobedience again and again.
Everything in this speech by Moses reminded the Israelites of the cost of their disobedience: an extra 38 years in the wilderness and death.
On the other hand, obedience was promised to bring life in Canaan:
Deuteronomy 4:1-2 And now, Israel, listen carefully to these decrees and regulations that I am about to teach you. Obey them so that you may live, so you may enter and occupy the land that the Lord, the God of your ancestors, is giving you. Do not add to or subtract from these commands I am giving you. Just obey the commands of the Lord your God that I am giving you.