Schlafmodus in Debian 10 abschalten

you can try the following based on your needs:
Disable suspend and hibernation:

				
					sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
				
			

To re-enable hibernate and suspend use the following command:

				
					sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
				
			

If you just want to prevent suspending when the lid is closed you can set the following options in /etc/systemd/logind.conf:

				
					[Login]
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
				
			

restart the service or reboot your machine

				
					systemctl restart systemd-logind.service