18 So the LORD said to Moses, "Take Joshua the son of Nun, a man in whom is the Spirit, and lay your hand on him.
19 Make him stand before Eleazar the priest and all the congregation, and you shall commission him in their sight.
20 You shall invest him with some of your authority, that all the congregation of the people of Israel may obey.
Since Moses was not going to enter into the promised land, he had to pass his position of authority on to someone else. God wanted Joshua, who was the only other one with Caleb who had confidence that God would give them the victory and the land.
The handing over of the authority was done in the sight of all of the people so that there was no doubt that Joshua was the one to follow. God also confirmed Joshua's authority by performing similar miracles through him to those he had caused through Moses. One of these miracles was the parting of the waters of the Jordan river for Israel to pass into the promised land.
Interestingly, the name 'Joshua' is a variation of the name 'Yeshua' which was transliterated into the English name 'Jesus'. Information like this should lead you to consider the life of Joshua carefully, as this suggests there will be important parallels between Joshua and Jesus.