What you're looking for is the hdparm utility.
It allows you to control your hard drives' power settings, apart from benchmarking and other stuff.
With hdparm -y /dev/sdX you put the disk into standby mode. This way, whenever you access the disk, it should automatically wake up and work back again.
There's an even deeper resting mode, which can be set with -Y instead of -y, but you may need to restart your computer in order to make the HDD work again, depending on the device.
Since manually having to put it to sleep is a bit of a hassle, you can set a timer to do it after a specific amount of time with the -S option.
From ArchWiki:
A device which is rarely needed can be put to sleep directly at the end of the boot process. This does not work with the above udev rule because it happens too early. In order to issue the command when the boot is completed, just create a systemd service.
/etc/systemd/system/hdparm.service
[Unit]
Description=hdparm sleep
[Service]
Type=oneshot
ExecStart=/usr/bin/hdparm -q -S 120 -y /dev/sdb
[Install]
WantedBy=multi-user.target
Then enable it.