On Windows I open CMD and type chkdsk /r

Then restart

For linux:

To check logs and health

sudo smartctl -a /dev/sda

To do a short scan:

sudo smartctl -t short /dev/sda

To view the results:

sudo smartctl -l selftest /dev/sda

I got something like this on one of my hard drives:

I did not try this but seemed like a nice temporary fix for a failing drive:

sudo badblocks -s -v /dev/sda > /scan_result/badsectors.txt

This scan can take a long time
Then when done use the file to exclude the bad blocks:

sudo fsck -l /scan_result/badsectors.txt /dev/sda