Mac keyboard shortcuts - Apple Support

Sleep, log out, and shut down shortcuts

               Shortcut              Description
Power button

Press to turn on your Mac or wake your Mac from sleep.

Press and hold for 1.5 seconds while your Mac is awake to display a dialog asking if you want to sleep, restart, or shut down. If you don't want to wait 1.5 seconds, press Control–Power button or Control–Media Eject 

Press and hold for 5 seconds to force your Mac to turn off.

Control–Command–Power buttonForce your Mac to restart.*
Control–Shift–Power button or 
Control–Shift–Media Eject 
Put your displays to sleep.*
Control–Command–Media Eject Quit all apps, then restart your Mac. If any open documents have unsaved changes, you'll be asked whether you want to save them.*
Control–Option–Command–Power button or 
Control–Option–Command–Media Eject 
Quit all apps, then shut down your Mac. If any open documents have unsaved changes, you'll be asked whether you want to save them.*
Shift-Command-QLog out of your macOS user account. You'll be asked to confirm.
Option-Shift-Command-QLog out of your macOS user account immediately, without being asked to confirm.

*Doesn't apply to keyboards that have a Touch Bar.