If you indeed have a bad battery, disconnect each cable on the battery and zip tie them together for a few hours.
It's kind of a "soft" reset.
Do it as well even if your battery is good, but get the charging system checked. Most auto parts stores will test your charging system for free.