Using the Power Button to Sleep & Wake
Tap the power button to put your Mac to sleep or to wake it up:
The power button works this way across all Macs using OS X Mavericks or later, including both notebook and desktop computers.
Access the Shut Down window
Press and hold the power button for three seconds to see additional options:
Hold down the Control key and tap the power button once to immediately display the same prompt. If your keyboard includes a Media Eject key (), you can also access this prompt by pressing the Control and Media Eject keys simultaneously.
Force your Mac to turn off
Hold down the power button for 5 seconds to force the computer to turn off. Important: You may lose unsaved documents if you force the computer to turn off this way. Use this method of turning off your Mac only if it has become unresponsive for an extended period of time. Normally you should shut down the computer by selecting Shut Down from the Apple menu, or from the shut down dialog pictured above.
VoiceOver and sleep
VoiceOver users do not receive an audible cue that the system has gone to sleep when pressing the power button. If your power button was accidentally pressed, wait a moment, then press the space bar to wake your system and continue working.
For more information about keyboard shortcuts, see "OS X keyboard shortcuts."