How to create a bootable macOS USB Flash drive
1- You will need to run the Disk Utility and erase the USB Fash Drive using MacOS Journaled.
2- Download macOS from the Mac AppStore into a local directory:
3- Go to Accessories and run “Terminal” and then execute the following command:
E.g. for macOS Big Sur:
sudo /Users/username/Downloads/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/Install\ macOS\ Big\ Sur -- /Users/username/Downloads/Install\ macOS\ Big\ Sur.app
4- After several minutes your USB Fash Drive should have a bootable macOS drive.