iPhone 11 Pro running iOS 16.3.1 becomes unresponsive
I recently purchased a used iPhone 11 Pro running iOS 16.3.1. I had the phone for one week when the screen became unresponsive. I tried turning off the phone using the side buttons, but when I got to the screen that has the sliding power-off button, it was unresponsive. I plugged the phone into my iMac and it did not show up in iTunes. The only thing I could think to do was erase the phone remotely, using Find My iPhone on my computer. Fortunately, I had previously backed up the phone. Now, a few weeks later, I had the same problem, and I resorted to the same solution. Is this most likely an iOS problem, or could it be a hardware problem? Could I have fixed the problem without resorting to erasing the phone?
[Re-Titled by Moderator]
iPhone 11 Pro, iOS 16