This laptop is quite old ( somewhere between 2011 - 2013) so it may just need the battery replaced. The good news is that if it works with the charger plugged in then it is in good shape.
open