Ответ на "Randomly turning off. and Also unable to turn back on for a while"this type of behavior is usually down to the system protecting itself from overheating. I’d start by checking the vents to see if there is much dust, dirt and debris in there, if so follow one of the teardowns and clean up as much as you can.
Ответ на "I bought a battery replacement and now it won't charge or turn on."Have you tried re-opening the phone and then unplugging the cables and plugging them in again, this is usually the issue.