Use the Check Disk feature in Windows
Windows has long had a built-in disk analysing feature called Check Disk (or chkdsk). This looks for errors, corruption, and bad sectors on a drive that could be causing problems. It won’t tell you that a disk needs replacing, but if you run it regularly then you’ll see whether the amount of faults are rising. It’s also just a useful tool to keep your drive in a healthy state.
To run Check Disk you need to open File Explorer, select This PC, then right-click on the drive you want to test. A pop-up menu will appear at the bottom of which is Properties.