Hi,
It may be a case of a overheating CPU that's why it shut's down by itself.
- Start by cleaning the inside of your laptop making sure that there's no dust stopping the fans from spinning also do apply a new thermal paste on both CPU and GPU.
- If it will not boot up still do reseat the RAM, take them all off for couple of seconds then put them back in making sure that they are seated properly.
- Next to try if it will not boot up still is to test your AC adapter and see if it's supplying enough voltage to power it or better yet try another AC adapter that has the same voltage.
- If all these will not work you may need to send the laptop for a repair if it's still under the factory warranty.