Checking by hand works until I forget. The smartd daemon from smartmontools does it on a schedule.
# /etc/smartd.conf
DEVICESCAN -a -m root -s (S/../.././02|L/../../6/03)
sudo systemctl restart smartmontools
-a monitors all the attributes and logs, -m root sends the warnings by mail, and -s sets a short test every day at 02:00 and a long test on Saturday at 03:00. Mail only arrives if the machine can send mail, so test it with -M test on the line. On Debian and Ubuntu the service is called smartmontools, and some other distributions call it smartd.
Further reading: smartd.conf manual page
Going deeper: Keep a domain pointed at your home with Cloudflare DDNS on Unraid