If your Mac spontaneously restarts or displays a message that it restarted or shut down because of a problem - Apple Support
You have experienced a kernel panic. Because you say this happens every time you try to boot your computer, then there is only one known fix, assuming there is no hardware failure.
Install El Capitan or Later from Scratch
If possible, back up your files.
- Restart the computer. Immediately, at or before the chime, hold down the Command and R keys until the Apple logo and progress bar appear. Wait until the Utility Menu appears.
- Select Disk Utility from the Utility Menu and click on the Continue button.
- When Disk Utility loads select the target drive (out-dented entry w/type and size info) from the Device list.
- Click on the Erase button in Disk Utility's toolbar. A panel will drop down.
- Set the partition scheme to GUID.
- Set the Format type to APFS (SSDs only) or Mac OS Extended (Journaled.)
- Click on the Apply button, then wait for the Done button to activate and click on it.
- Quit Disk Utility and return to the Utility Menu.
- Select Install OS X and click on the Continue button.
Dealing with Kernel Panics
Disconnect any third-party peripherals including any USB hubs. How to use safe mode on your Mac, Use safe mode to isolate issues with your Mac - Apple Support then boot the computer into Safe Mode: Use safe mode to isolate issues with your Mac - Apple Support and Playing Safe- what does Safe mode do? See Diagnosing problems- crash, freeze, panic, or spinning beach ball?, Don’t Panic! Understanding & Troubleshooting Kernel Panics in macOS, How to fix kernel panics after installing OS X updates | MacIssues, and If your Mac restarted because of a problem - Apple Support.
Kernel panics are indicative of possible hardware failure, so you should Check your Mac with hardware diagnostics or AHT. Kernel panic logs are found in: /Library/Logs/DiagnosticReports/ folder.
If you have no success figuring what is happening then you may need to examine the software you have running when the panics occur. Be sure it’s all current. If you must to resolve the problem erase the disk and reinstall macOS. Follow this outline to reset the computer to the factory-new state: Factory reset of your Mac - Apple Support.
Boot Into Safe Mode
- If your Mac isn’t already shut down, then shut it down and wait at least 30 seconds before rebooting.
- Immediately, at or before the chime, press and hold down the SHIFT key.
- Release the key after the Apple logo and progress bar appear.
- Safe mode startup is much slower than normal startup, so be patient.
- When the Login Screen appears enter your admin password. If you use automatic login, then this means you are in safe mode.