Formatting and reinstalling macOS
How to make a bootable usb with the Sierra installer from the App Store.
Change "MyVolume" to the name of your usb drive

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume --applicationpath /Applications/Install\ macOS\ Sierra.app