I wanted my computer to sleep at 11:59pm local time each night and wake up each morning at 9:00am.
And I know that cronjobs can help with this.
I used a tool (such as https://cron.help/#59_23_*_*_*) to show me that the correct syntax for the go-to-sleep schedule that I want is 59 23 * * *.
And then I needed to calculate how many seconds the sleep should last: 9:00am is 9 hours + 1 minute after 11:59pm. (9 * 60 + 1) * 60 = 32460 seconds
So I ran crontab -e to edit the cron jobs via vim and added these 2 lines:
# inspired by https://askubuntu.com/a/1348204/48214 and https://askubuntu.com/a/1012051/48214 and https://itectec.com/ubuntu/ubuntu-automatically-sleep-and-wake-up-at-specific-times/
59 23 * * * /usr/sbin/rtcwake -m disk -s 32460 >> /code/cron.log 2>&1
And I saved the file.
The steps above will work for most people on most computers, but unfortunately I realized from this quick test that my particular ancient computer has problems with rtcwake.
So instead, what I'm using now only suspends my computer on a schedule, and I haven't figured out how to schedule waking up yet:
59 23 * * * echo "$(date) Running /usr/local/bin/systemctl-suspend" >> /code/cron.log && /usr/local/bin/systemctl-suspend >> /code/cron.log 2>&1
which I got from https://unix.stackexchange.com/a/642533/48973.