Adding on to the earlier comments you can run tests against the drive with smarctl e.g.
smartctl --scan (scans and lists all drives connected to your system)
smartctl -t short /YOUR/DRIVE (short non-destructive drive test, usually takes 3 minutes or so, afterwards run smartctl -a again to view test results towards the bottom of the output)
smartctl -t long /YOUR/DRIVE (this is a long more thorough test, non-destructive, this can easily take a few hours or even days depending on the size of your drive and whatnot)
smartctl -a or smartctl -x will give you testing progress in its output.
Or another option, if you can't run smartctl for some reason, and you're just testing a regular HDD not SSD, look into running a badblocks non-destructive scan.