could also be the controller if they're connected to the same SATA controller. the way to rule that out is connect to another PC (or another controller if you have a mobo with multiple SATA controllers, for example one from Intel and one from Marvell)
if they both failed when connected to the same port and cable, you could also suspect the data cable and SATA port. try a different cable and a different port on the motherboard (ports tend to fail in pairs, so test with a port not adjacent to the one you think is failing).
then to check the drive you can do diagnostics
check SMART info (there's plenty of software out there for the purpose)
also use the manufacturer's diagnostics utilities (should be downloadable from the manufacturer's site, and may provide SMART info too)
also look at event viewer for disk errors. if you get lots of bad blocks that's an indicator of a drive going bad.