"Then they answered Joshua, 'Whatever you have commanded us we will do, and wherever you send us we will go. Just as we fully obeyed Moses, so we will obey you. Only may the Lord your God be with you as he was with Moses. Whoever rebels against your word and does not obey your words, whatever you may command them, will be put to death. Only be strong and courageous!'" NIV translation
The people pledged to follow the instructions of Joshua because they knew that he was put into his position by God. He did not go to some leadership training course or get a college degree but was simply chosen and equipped by God.