If you want to prevent your Mac from sleeping automatically for MacOS Big Sur, please refer to the following steps:
1. Click Apple icon on the screen and click "System Preferences"
2. Click "Battery"
3. Click "Power Adapter" and check the option "Prevent computer from sleeping automatically when the display is off"
4. Click "OK"
Then you can prevent your Mac from sleeping automatically for MacOS Big Sur