My phone keeps restarting when charging; I don't know any solutions to fix this because the buttons are no longer working, and I can only rely on charging when trying to open the phone.
Welcome to Android Central! It could be a failing battery, but it could also be a problem with the motherboard. You'd probably have to bring it to a repair shop, but considering that's a 6 year old phone, I don't think the repair cost will be worth it.