Hello again JonathanOh,
Unless a HDD has an electrical problem such as a short circuit it will not cause a computer to shut down, a HDD that is corrupt or has no OS on it will result in an on screen message such as "no boot device found" or "restart computer and select a boot device".
Two common causes of a computer suddenly switching itself off are loss of power and heat, other less common includes a loose memory or add on card.
Loss of power can be caused by a bad battery or AC adaptor (including the power outlet it is connected to) in the case of a notebook computer.
Heat causes shutdowns in various ways but the most common is the CPUs thermal sensor detecting temps that are too high, it then shuts down the computer to protect the CPU and other hardware, this type of overheating is normally caused by a failed or clogged cooling fan and/or heatsink fins, both are relatively easy to check, do you hear the cooling fan running when the notebook is turned on for example.
A more difficult problem to identify where heat is concerned is a break in the printed/soldered circuit, if there is a break when the MB gets warm it expands and this can cause a break in the soldered circuits.
To avoid repetition tell us what if any steps you may have tried already, have you tried reseating the Ram for example.