Mac starts up, but the screen is garbled
With a 15-inch MacBook Pro (2011-2013), graphics processor failure is a known problem. Apple may repair later models (see bit.ly/mbpvidiss) but otherwise workarounds (such as bit.ly/gpuwkrnd) are poor/impractical. For other models, try Apple Diagnostics.
If your Mac starts up with a flashing question mark icon, it means it can’t find a drive with a macOS installation. Let it try; if it does eventually start up, go to System Preferences > Startup Disk and select the correct drive. If not, try macOS Recovery.
If your Mac starts up with the screen overlaid with ugly text, it’s a kernel panic. Restarting again may work. If not, restart in safe mode and install any software updates. No? Unplug all peripherals, restarting them one at a time.
If the screen stays gray, be patient as macOS may be doing housekeeping. Still nothing? Try safe mode with peripherals disconnected, as above. Reset the SMC. No? If possible, remove any extra memory you’ve added (with power disconnected) and try without it.