My Iphone 4s keeps freezing then shutting off?

This started happening about two weeks ago, and it's happened around five times. What happens is it freezes up and I can't do anything on it, then it just shuts off.
If I try to turn it back on it doesn't do anything. Even if I plug it in the charger. And the logo doesn't even show up if I hold down the lock button. Then after about five minutes it'll turn back on.
What's wrong with it?

5S 5S TRY COOLING IT DOWN TAKE THE BATTERY OUT LEAVE IT FRONT OF THE AC OR SOMETHING

  • Wi-Fi keeps shutting off automatically on iPhone? I recently purchased an iPhone 4S and ever since I connected it to my Wi-Fi home network it has been disconnecting off of the Wi-Fi and using my 3G. The Wi-Fi works great on my other devices, and I have to keep manually going to settings to connect it. Please tell me what to do to fix this issue and let it stay on the network until I manually disconnect it. 10 POINTS for the correct answer
  • My iphone keeps shutting off? I have an iphone 3g. The only way it will stay on if its on the charger or if its off the charger it must be playing music to stay on, but as soon as the music stops playing it will turn itself off and then start blinking the apple. The apple will come up and then go away and then come back. This just started happening lastnight, how can i fix it?
  • My Iphone keeps shutting off, but before it shuts off, my screen freezes and there's these lines that show up, they're random? My Iphone keeps shutting off, but before it shuts off, my screen freezes and there's these lines that show up, they're random. Sometimes there's this crackling sound, and sometimes the line move, my mom says its just the phone, but my dad says, its the proccecor and that its overheated, i have an Iphone SE rose gold 64 gb and my iOS is 12.3.1
  • My Iphone keeps shutting off? - 1 I have a Iphone 4 that is jailbroken, i bought it like this. About 2 months ago it just shut off on me and would only work on the charger a couple days after that it wouldnt work at all, i took it into apple and they tested the battery and it was good. A few days after that it shut off again and now won't work at all. Any ideas how to fix it or what's wrong with it