Another possibility using systemctl
Disable hibernate:
sudo systemctl mask hibernate.target
Test
sudo systemctl hibernate
Failed to start hibernate.target: Unit hibernate.target is masked.
Back to enable hibernate:
sudo systemctl unmask hibernate.target
Turn off all rest states (Sleep, suspend, hibernate, hybrid-sleep)
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Back to enable all rest states
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target