ClickSystem SettingsorSystem Preferencesfrom the Apple menu in the upper left corner.
ClickLock Screen, then go for the menu next toTurn display off on power adapter when inactive.
ClickBatteryfrom the menu, then chooseOptions.
Switch on the toggle next toPrevent automatic sleeping on power adapter when the display is off.
Plug your MacBook into power.
Connect your MacBook to an external monitor using an adapter if necessary.
you’ve got the option to now close your MacBook without the external display turning off.
Note that the display on the MacBook itself does turn off, just not the external monitor.
Why Does My MacBook Sleep When I terminate the Lid?
Your MacBook sleeps when you kill the lid for several reasons, depending on whether it’s plugged in.
When running on battery power, it sleeps when you kill the lid to conserve battery power.
Apple makes that reasonably easy if you follow the instructions provided in the previous section.
Can You Keep a MacBook From Sleeping With the Lid Closed Without a Monitor?
FAQ
SelectSystem tweaks>Battery>Options.
Turn onPrevent automatic sleeping on power adapter when the display is off.
Ensure the setting for turning off the display is active.
Go toSystem configs>Lock Screenand review those configs.
Also, in theBatterymenu, chooseOptionsand disable thePrevent automatic sleepingtoggle.
Also, check Bluetooth wake tweaks:Bluetooth>Advanced> uncheckAllow Bluetooth devices to wake this computer.