When your Mac experiences a random shut down, the best thing to do is reboot it and immediately restart it again. This two-step process is necessary because some programs don’t always shut down correctly the first time around. To begin the second reboot, select Restart from the Apple menu.

Unfortunately, just rebooting your Mac might not solve the problem. If this is the case, Apple recommends resetting the SMC, which is a subsystem of Intel processor-based Macintosh computers. It is similar in function to the older System Manager Unit (SMU) or Power Management Unit (PMU) of non-Intel Macintosh computers. The SMC controls your computer’s thermal and power management, battery charging, video mode switching, sleep and wake, hibernation, and LED indicators.