Sudden shutdown is typically caused by overheating. It shuts down to prevent damage to the system's vital (and expensive) components.
Make sure all the cooling vents are clear of fluff build-up.
Don't have the laptop resting on blankets or on your clothing when it's being used as the soft surfaces can block the vents underneath. Always place the laptop on a hard surface or on a tray on your lap. This will ensure that there's always a gap underneath it where hot air can escape and cooler air can be drawn in.