There could be a couple of things wrong with it. One of the first things that comes to mind for me would be heat if it's randomly turning off. I would take a can of air and blow out all the exhaust ports on the laptop and see if that fixes the issue.