You only need to press a few keys to turn off your monitor and leave your Mac running. The monitor turns off and goes into sleep mode, and the computer continues to operate.
Steps
Method 1 of 2: Using a keyboard shortcut

Step 1. Press Control-Shift-Eject at the same time
If you can't find the Eject key, press Control-Shift-Power
Method 2 of 2: Using Hot Corners

Step 1. Open the "System Preferences" window
Click Desktop & Screensaver.

Step 2. Tap Screensaver> Hot Corners

Step 3. Change the option of one of the active corners to “Put the monitor into sleep mode”

Step 4. Turn on the selected active corner
To do this, move the mouse cursor to it. For example, move your cursor to the lower-right corner (if you have configured this exact corner) and wait a few seconds. The screen will turn off.
Advice
- The screen backlight uses up a lot of energy, so turn it off when not in use to reduce the rate at which your laptop's battery is draining.
- Putting the monitor into sleep mode improves the security of your computer. If you set a password to wake up from sleep mode in the security settings, the user will have to enter it to turn on the monitor.