Depends on what operating system and desktop you are using. In OMLx 3 using Plasma5 desktop go to SystemSettings5>Hardware>Power Management>Energy Saving. I think that this setting is desktop dependent. Like all SystemSettings5 settings it is user dependent. There is also a setting for this in the LXQt desktop. My only frame of reference currently is an ASUS X550C notebook and here “Do nothing” works in both Plasma5 and LXQt. (So does suspend.)
To do this globally you would need to something form command line with systemd. Again assuming Lx 3 OS. You can find out more about this with an Internet search.