After taking the laptop apart I found that there was a huge accumulation of dust and animal hair clogging the cooling system which meant that the components inside could not cool down properly. Unfortunately the computer had heated up to a point that it killed one of the main components on the system and therefore it needed replacing.
If your laptop is getting hot and sometimes shuts off it could be damaging the components inside and could end up costing you a lot of money to fix or even render that laptop useless. One of the ways to tell if the laptop needs to be cleaned out of dust and hairs is to listen to the fan. If it's constantly spinning and you can't feel air coming out of the laptop vents then it may be clogged and will need to be cleaned out to prevent damage. If it is left you could end up severely damaging your computer.Although Laptops are called Laptops it does not mean you should use them on your lap as this will cover the ventilation system. Another common way of overheating and collecting dust is by using the computer on your bed where the bed sheets cover up the ventilation holes and therefore overheating the Laptop. Instead try using a hard back book and then place the laptop on that.