I use a Macbook Pro, running macOS Catalina, and have often found that it will sometimes go to sleep at unfortunate times. Namely, when I am downloading or uploading stuff. So this little HOWTO will show you one way you can prevent that.
Just use the caffeinate command. Simply open a terminal and enter:
Last login: Sat Jul 11 17:56:01 on console
yourname@your-MacBook-Pro ~ % caffeinate -s
As long as your system is on AC power, that command should prevent your system from entering sleep mode. Now your downloads/uploads will continue uninterrupted. And when you’re done, simply press CTRL+C while focussed on the terminal to cancel the command. You’re welcome.