You might be in a situation where your iPhone is continuously rebooting itself, the main thing I want to highlight is maybe some of your data may be lost, but it can be recovered from many different sources, whether in an iCloud backup then you will be good that’s why I recommend people downloading like Google photos and things like that because those things actually sync up your photos to the cloud or your iCloud information like your contacts and iMessages most likely those will be backed up. The first thing you need to do is make sure you have either a Mac or a Windows and also iTunes installed. Next you want to make sure your device is totally powered off, next go ahead and plug it into the computer, the important thing to do here is while you’re plugging it in immediately hold down the power button and the volume down button (on some iPhones, please search how to put your specific iPhone in restore mode). Your iPhone will show an Apple logo, filed by the connect to iTunes logo, once you see this logo then you are good to go.
At some point iTunes will say it found your device, there will be random popups and just keep clicking “accept” and “continue”. At some point iTunes will state that there’s a problem and they’re going to have to restore the iPhone, go ahead and click update. iTunes will go ahead and check for an update, if it says it can’t be updated, you’re going to have to factory reset it. Once you click update iTunes will go ahead and download the latest version of iOS (which will take a while).
Once it’s downloaded, iTunes will prompt you to accept the new update, and it will immediately start installing the iOS file it just downloaded. This process will take a bit of time, DO NOT unplug your iPhone while it’s updating. Once it’s done being restored, your iPhone will begin to restart and come back to the home screen, it is very important to restore any backed up information at this point.