A long download or render is running and the bright screen is just in the way. You can switch the display off without putting the Mac to sleep.
One command, no sudo needed:
pmset displaysleepnow
The screen goes dark at once. Apps, downloads and ssh sessions carry on, because only the display sleeps. Move the mouse or press a key to wake it.
It is nice at the end of a chain. I like it combined with caffeinate, so the Mac itself stays awake for a job while the screen goes dark:
caffeinate -i ./render.sh &
pmset displaysleepnow
The bigger brother is pmset sleepnow, which sleeps the whole machine and stops whatever is running, so don’t mix them up in a script.
Depending on your settings, waking the display may ask for your password, because the screen lock follows display sleep. That is set under Lock Screen in System Settings, with the option to require a password after the screen turns off.
Further reading: pmset man page (macOS)