Moses was given the commandment from God to choose 12 people to spy out the land of Canaan. Among those chosen were Joshua and Caleb.
“And the Lord spoke to Moses, saying, 'Send men to spy out the land of Canaan, which I am giving to the children of Israel; from each tribe of their fathers you shall send a man, every one a leader among them.” (Numbers 13:1-2)
The 12 men spied out the land and brought back fruit as evidence that the land was in fact a "good" land. The men reported back after 40 days. All 12 gave a positive report on the fruitfulness of the land, but 10 were afraid of the inhabitants. Only two were ready to take possession: Caleb and Joshua.
“And they spoke to the congregation of the children of Israel, saying: 'The land we passed through to spy out is and exceedingly good land. If the Lord delights in us, then He will bring us into this land and give it to us, 'a land which flows with milk and honey.' Only do not rebel against the Lord, nor fear the people of the land, for they are our bread; their protection has departed from them, and the Lord is with us. Do not fear them.'” Though they did not deny the existence of foes in the promised land, Caleb and Joshua chose to trust in God for their victory and inheritance. It is for this reason that God chose Joshua to become Moses successor and Caleb to be Joshua's general.
Because of Israel's fear and disobedience they were doomed to walk in the wilderness until the previous generation had died there. Joshua continued faithfully in his service and honored Moses long after the death of his leader. As Moses lie dying, he asked the Lord who will lead the people into the promised land.
“And the Lord said to Moses: 'Take Joshua the son of Nun with you a man in whom is the Spirit, and lay your hands on him; set him before Eleazar the priest before all the congregation, and inaugurate him in their sight. And you shall give him some of your authority to him, that all the congregation of the children of Israel may be obedient.'” Joshua was now the appointed leader of Israel. Not because of might, his brains or good looks but because of his service and obedience. Shortly before the conquest of Canaan the Lord spoke to Joshua.
“Moses my servant is dead. Now therefore, arise, go over this Jordan, you and all this people, to the land which I am giving them-the children of Israel. Every place that the sole of your foot will tread upon I have given you, as I said to Moses. From the wilderness and this Lebanon as far as the great river, the river Euphrates, all the land of the Hittites, and to the great sea toward the going down of the sun, shall be your territory. No man shall stand before you all the days of your life; as I was with Moses, so I will be with you. I will not leave you nor forsake you. Be strong and of good courage, for to this people you shall divide as an inheritance the land which I swore to your fathers to give them. Only be strong and very courageous, that you may do according to all the law which Moses My servant commanded you; do not turn from it to the right hand or to the left, that you may prosper wherever you go. This book of the Law shall not depart from your mouth, but you shall meditate in it day and night, that you may observe to do according to all that is written in it. For then you will make your way prosperous, and then you will have good success. Have I not commanded you? Be strong and of good courage; do not be afraid, nor be dismayed, for the Lord your God is with you wherever you go. ” (Joshua 1:2-9)
The words that the Lord spoke to Joshua are the same words He is speaking to all who follow Christ. “"Be strong and of good courage." ” When we choose to live a life of service and obedience ,the Lord promises good success. These words were meant to be an encouragement to Joshua in a time of great change, but they were written by God to be an encouragement to all.