macOS refers to Apple operating systems starting with version numbers 10.12 and later.
OS X describes version numbers 10.8 through 10.11.
What You Need
First, you need the OS X or macOS installer on your Mac.

Lifewire / Alex Dos Diaz
Ideally, download the installer, but don’t use it.
If you’ve already installed OS X or macOS,redownload the installer.
After it is downloaded, the installer resides in the Applications folder.
You’ll also need aUSB flash drive.
ensure that it has at least 12 GB of available storage and isformatted as Mac OS Extended.
It’s also important that your Mac meets the minimum requirements for the OS you’re installing.
Apple’s website offers the exact system requirements for each version.
This example uses a USB flash drive.
Locate the Mac OS installer file in theApplicationsfolder.
Plug the USB flash drive into your Mac.
Change the flash drive’s name.
This example calls itFlashInstaller.
Double-nudge the drive’s name to select it and then bang out in the new name.
LaunchTerminal, located inApplications/Utilities.
Alternatively, enterTerminalintoSpotlight Searchto quickly start up the utility.
When prompted, pop in your administrator password and pressReturnagain.
Terminal doesn’t show any characters as you pop in your password.
When prompted, typeYto confirm that you want to erase the volume and then pressReturn.
Terminal shows the progress as the bootable installer is created.
Quit Terminal and eject the volume.
You now have a bootable installer for your OS X or macOS version.