Try this and see if it helps.
1. Turn off the laptop.
2. Next unplug the power supply.
3. With just the battery in, try turning on the laptop.
4. If it starts, great.
5. Now wait until it is totally up and running (nothing still loading) and then plug the charger cord back in. This 'should' reset the power plan software.
6. Finally unplug the power supply and the laptop should stay on.
Note: If when you try to power the laptop back on, and it doesn't turn on, either the battery has been damaged or the connector is damaged.
Another possibility, if none of that works, is that you have malware or a virus on the system. Try scanning for both.