Moses sent 12 men to spy on Canaan and report back with the findings. Among them were Caleb and Joshua.
After 40 days they returned with massive clusters of grapes. The produce was excellent they proclaimed. However some of them said the people and their cities were too much to overthrow.
Caleb quietened down the pessimism by saying "Let us go up at once and occupy it; for we are well able to overcome it." Numbers 13.30 Some of the others contradicted him saying that the people were like giants and the Israelites no match for them.
Right away despondency spread in the camp. The people were looking backwards to Egypt as their future land. In the midst of the negativity, Joshua stood up and stated an extremely optimistic prophecy. "The land which we passed through to spy out, is an exceedingly good land. If the LORD delights in us, he will bring us into this land which flows with milk and honey. Only, do not rebel against the LORD; and do not fear the people of the land, for they are bread for us; their protection is removed from them, and the LORD is with us; do not fear them." Numbers 14.7-10
Joshua said all the right things which were exactly what God was thinking for them. Of the spying party only Joshua and Caleb spoke wisely.
The vision Joshua and Caleb gave Israel their future and was Gods will for them. But not all of them accepted God's word. God penalised all those age 20 and over of the murmurers by not allowing them to cross the Jordan to enter the promised land. Except Joshua and Caleb. God said "Not one shall come into the land where I swore that I would make you dwell, except Caleb the son of Jephunah and Joshua the son of Nun." Numbers 14.30
Speaking and thinking what God says is needed to enter into his promises. It is important to think and speak in faith and not look and speak with the natural.