There were several lessons that Joshua needed to learn before he could be used fully by God. First, he needed to know that he must trust in the Lord during every day and in every battle. He couldn't coast on yesterday's victories. He needed God in a fresh way every day. Second, Joshua needed to learn that the only way in which we can lead God's people into battle is to be led by the Captain of the Lord of hosts.
Spiritual leaders are great followers.
He had to know that he wasn't the bottom line person. He wasn't the ultimate authority. He must know intimately and submit to the Captain of Captains and the King of Kings. I have had the privilege of knowing a few Generals in my life time. There's one thing that I know about great military leaders.