Hi,
One common cause of a random shutdown is due to overheating. But do try these troubleshooting steps that may help in solving the issue.
- First is to test the battery and AC adapter and make sure that they are supplying the correct voltage to power the laptop. Also do test the laptop if it will still shutdown on it's own with just the AC adapter connected.
- If it will still shutdown you may need to open the laptop and clean the inside of it making sure that all the fans inside is free from dust or debris that would stop it from spinning. Also apply a new thermal paste that would help a lot in cooling down your laptop.
- If all these will not work you it would be best to get a cooling pad that should help in cooling down the laptop and prevent it from overheating.