There could be a number of causes. For instance, how's the battery? Check Settings>Battery>Battery Health. This phone is 6 or 7 years old, right? The battery may not be able any longer to handle all its system's requirements, so it just shuts down and tries again, over and over. Have you tried plugging it in to power? You should try to turn off power hungry stuff-- turn off wifi, gps, bluetooth, etc. That might work, or maybe not.
Or it could be other hardware problems. Again, turning off those things might help. Fixing those, if it's worth it, will probably require fully reseting the phone.
Have you tried plugging it into a computer to do a wired (and powered) backup?
Or it could be software. Try a forced restart-- that might clear some things out:
Force restart iPhone - Apple Support
This is different from a simple Power Off. I had to continue holding the button down past the "slide to power off" message, and then I released the button only after the Apple Logo appeared indicating a re-start.
It's very possible that the phone is just dying of old age. 7 years is more than a lifetime in computer years.