We’ve already covered how to do this from the command line (See How to create a bootable USB to install OS X), but I wanted to give those with a fear of the command line a way to do the same thing.
With this handy flash drive, you can reinstall macOS, should something go awry. Stop! Before you do anything to that costly (and wonderful) piece of hardware, you should consider creating a USB installer drive for macOS. You bought that shiny new MacBook Pro or iMac, and you’re ready to start working. With the help of a GUI, Jack Wallen shows you how to create a handy flash drive for macOS. Your new Mac doesn't include an installation media.
How to create a bootable USB installer drive for macOS