For the Lord your God will be with you wherever you go.
So why are so many Christians weak and cowardly? Why are they wrapped up in fear and walking around discouraged?
Because they take this scripture (Joshua 1:9) as a suggestion, not a command.
If you permit feelings of discouragement to take root in your life, you are disobeying God. And since He commanded you not to be discouraged, that means you get to choose.
Discouragement presents itself as an option, and you choose whether to receive it or reject it.
You'll have plenty of opportunities to be discouraged. What are you going to do?