A drive can say PASSED while it is already losing sectors. I treat the verdict as the first line and read on.
sudo smartctl -H /dev/sda
-H prints the overall health self-assessment of the drive. FAILED means back up now. PASSED only means that no attribute has crossed its manufacturer threshold yet, which many failing drives never do. Follow it with smartctl -A and the self-test log. On NVMe drives the same command reports the critical warning flags. In a script, test bit 3 of the exit status (value 8), which smartctl sets when the health check says DISK FAILING. Other bits report other problems, so do not treat every non-zero status the same.
Further reading: smartctl manual page
Going deeper: Keep a domain pointed at your home with Cloudflare DDNS on Unraid