on MacOS, caffeine is a good tool but if you need it in dock (pill?) form, the amazing Amphetamine app is there for you. It'll even (if you use safari) keep you up just long enough to finish that big download. https://apps.apple.com/us/app/amphetamine/id937984704?mt=12