phone keeps turning off and on again
The other day my iphone x started acting weird. It randomly just shut off. At first it was just an isolated event I thought then it happened again a few hours later. Ever since then it's been happening over and over again. It'll randomly shut off even if I'm doing something. Or it'll just shut off completely in my pocket. I had my airpods connected and listening to music and it shut off mid-song. I figured it was maybe a problem with the airpods glitching up my phone or something but even without them connected, it kept shutting off. I even reset the pairing to the airpods by forgetting them and reconnecting.
My iOS was outdated so I thought maybe updating it would fix it. I updated it to 14.8.something and it didn't shut off for a half hour but it's back at it going on and off again. I'm working on updating it to iOS 15.
The weird thing is that after it shuts off, it tries turning itself back on. It takes so long to turn on because it's like its stuck in a loop of trying to turn itself back on and then failing then trying again. Like my phone shut itself off and for the past five minutes the logo you see when you turn the phone on keeps appearing and disappearing.
I got this iphone in May of this year and it's been working fine. I got it as a replacement for my iphone 8 because it broke and they were trying to get rid of the iphone x models they had left. It's not the xr/xs it's just the regular x.
It's been working fine so far before this. There wasn't any significant water damage or drops recently. It's not a battery issue either. It did it at 30%, 50% and even when it was at 90%. My battery health said 93% so I don't think it's a battery issue. I can't find anything online about this situation exactly but an article said to hard reset my phone so I need to back up everything first. I want to use a hard reset as a last resort.
Has anyone experienced this or know how to fix this?
iPhone X, iOS 14