Since HDD controllers will remap sectors, you can only check a drive by looking at such things as the reallocated sector count over time.
That is what PassMarks s/w does.
You can look at the reallocated raw sector count - but this varies widely depending on model and usage! For instance a high-density 2.5" drive in a laptop would have a lot more reallocated sectors after 6 months than a 10,000 rpm 5.25" Server HDD.
You can read contiguous disk sectors and look for any sector reads which take longer that usual.
This may indicate bad sectors which have to be retried or even ECC corrected by the HDD controller - however, some of the sectors may actually be reallocated sectors on a different track - in this case you would expect the read to take longer because the head has to go to a different track for that block read. So it is normal for an old 2.5" laptop HDD to have many 'longer' reads.
The DiskDoctor is a Windows .exe and is part of RMPrepUSB (CTRL-D). It can do sequential scans of a HDD and look for sectors which take longer than the normal time to be read. However, for an 'old' drive, this does not necessarily mean it is currently 'bad' because it may simply be reading reallocated sectors. On a brand new drive, you should see very few 'excess time' read warnings.
I am afraid predicting an HDD failure is difficult. The most common problem is to have a head crash due to mishandling. In this event you will have lost data. So making regular backups is the only real solution.
And use your ears - if you hear it whistling/whining or sometimes the head seems to recalibrate, grate, stutter or step slowly during accesses, then that is a good warning!