How do you know which is which? If it’s a hardware problem, the drive will almost always make strange noises. If you’ve never had the misfortune to hear them coming out of your own computer, you can listen to the recordings on DataRecoveryNet. If you do hear any of these sounds coming from your own computer, turn it off immediately to minimize the damage to the drive. And you’d better hope the drive is still under warranty, because you’re going to need a new one, on top of paying the fees for data recovery if you don’t have a recent enough backup.
Sometimes when your computer crashes and won’t reboot, it’s essentially a software issue, and all you need to do is reformat your drive. But sometimes your drive has literally crashed, meaning one or more parts has come loose and is chewing its way through the rest.