Hey there P0150onnn,
Thanks for reaching out to the Apple Support Communities. If having issues with the device restarting unexpectedly when trying to set up the device, the best option would be to put the iPhone into recovery mode, and restore the device using a computer.
For the best steps on how to do this, check out this link here: If you can't update or restore your iPhone or iPod touch - Apple Support
Put your device in recovery mode and set it up again
1. Make sure that your Mac is up to date. If you're using iTunes, make sure you have the latest version of iTunes.
2. On a Mac with macOS Catalina or later, open Finder. On a Mac with macOS Mojave or earlier, or on a PC, open iTunes. If iTunes is already open, close it, then open it again. Find out which macOS your Mac is using.
3. Keep your device connected and wait until the recovery mode screen appears:
- iPhone 8 or later, including iPhone SE (2nd generation): Press and quickly release the volume up button. Press and quickly release the volume down button. Then, press and hold the side button until you see the recovery mode screen.
4. Locate your device on your computer. When you see the option to Restore or Update, choose Update. Your computer will try to reinstall the software without erasing your data. Wait while your computer downloads the software for your device. If the download takes more than 15 minutes and your device exits the recovery mode screen, let the download finish, then repeat step 3.
5. After the Update or Restore completes, set up your device.
Keep us updated on the results, and we'll continue from there.
Take care!