If you haven't done the OS sleep setting here is how to do it:

  1. Step: System Settings --> Battery --> Options --> Prevent automatic sleeping on power adapter when display is off
  2. Step: System Settings --> Screen Saver --> Lock Screen Settings --> Start Screen Saver when inactive (Never)
  3. Step: System Settings --> Screen Saver --> Lock Screen Settings --> Turn display off on power adapter when inactive (Never)

IF YOU INSTALLED AMPHETAMINE THEN SET IT TO 2 MINUTES TO PREVENT SCREEN BURN-INS

Then:

  1. Step

Download "Amphetamine” from the App Store (https://apps.apple.com/us/app/amphetamine/id937984704?mt=12)

  1. Step

Configure the settings in Quick Settings menu like this:

-Allow display sleep ✅

-Allow system sleep when display is closed ❌

-Allow screensaver after 45 minutes of inactivity❌

  1. Step

Click on “Indefinitely” under the menu “Start New Session” and close the lid of your MacBook!