If your Mac restarts and a message appears
If your Mac restarts unexpectedly, an error known as a kernel panic occurred. After the restart, you’ll see a message that your computer restarted because of a problem.
The most likely cause is faulty software. A kernel panic can also be caused by damaged or incompatible hardware, including external devices attached to your Mac.
Note: To print these instructions, press Command-P.
If the kernel panic is caused by a known problem, the faulty software is identified. To make sure that this software doesn’t continue to cause kernel panics, move it to the Trash.
If the faulty software is not identified and your Mac continues to experience kernel panics, try the following:
Restart your Mac in safe mode. If it successfully starts up in safe mode, choose Apple menu > App Store, click Updates, then install any available updates.
Uninstall any plug-ins or other enhancement software from manufacturers other than Apple. If you recently updated macOS or an app, plug-ins and other software that worked in the past may no longer be compatible. Read the manufacturer’s documentation (including Read Me notes) to be sure the software is compatible with your version of macOS.
Disconnect all USB and FireWire devices except for the Apple keyboard and mouse. Remove hardware upgrades from other manufacturers, such as random-access memory (RAM) and Peripheral Component Interconnect (PCI) cards. Then try restarting your Mac.
If this resolves the issue, reconnect one device at a time, restarting your Mac after reconnecting each one, until you determine which device is causing the problem.
Diagnose problems with your Mac. These apps can tell you if hardware you installed, such as additional memory, is incompatible, improperly installed or defective.
Use Disk Utility to repair your startup disk or your disk permissions.
If the steps above don’t help, try reinstalling macOS.
Note: If you moved or renamed a system file or folder, you must reinstall macOS — it won’t work to just replace or rename the item.