God tells Joshua no one will be able to stand against him for God is with him in all things “to which [he] goes.” God commands him to be comforted by his knowledge of this truth, and so not to dread or fear anything he may face.
“Lo! I command to thee; be thou comforted, and be thou strong; do not thou dread, nor be thou afeared; for thy Lord God is with thee in all things, to which thou goest. (Lo! I command thee; be thou encouraged, and be thou strong; do not thou fear, nor be thou afraid; for the Lord thy God is with thee in all things, to which thou goest.)”
If you believe God is with you in all things, then fear is impossible. Only comfort makes sense.