If your PC is frequently shutting down then there must be a problem with your hard drive. So better make a backup of your data before going a further step. Here in this post, we are going into brief detail of tools which might help you know the health status of your hard drive.
If your drive is from the reputed company then you can download hard drive testing tools from their manufacturer website. For Seagate, use the SEAtools, Hitachi and Western Digital use HGST, and Samsung uses Magician.
You can also try simple third party tools to find the status of your hard drive. One of the popular tools in the tech community is Crystal Disk Info. It is a portable application that gives you an instant report. Blue means good, red and yellow indicates problems. It doesn’t do any advanced testing.
If you think your hard drive is having a lot of bad sectors then you can scan it with HDD Scan tool. It gives similar info as the Crystal Disk Info tool.