refer to your user manual or manufacturers website to know how to set boot priority order. Tip: You can set your external hard drive or SSD as default drive from BIOS settings.
In the Terminal Window, type diskutil list and note down the disk no.After entering the command, press Enter/Return and wait for it to finish.
Sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia -volume /Volumes/MojaveInstaller Replace MojaveInstaller if you have given a different name to your USB stick