On Windows I've been using "Don't Sleep" [1] and have now switched to "PowerToys Awake" [2] for one-click sleep prevention. On macOS I've used Caffeine [3] for that purpose. KDE on the other hand already has a built-in check box to prohibit sleeping in the power/battery control applet.
There seems to be quite a market for this teeny tiny tools.
[1] https://www.softwareok.com/?seite=Microsoft/DontSleep [2] https://learn.microsoft.com/en-us/windows/powertoys/awake [3] https://www.caffeine-app.net