However, a factory reset of your iPhone will erase all of your iPhone apps, files, and valuable data, and restore it to the state it was in when you first purchased it. As a result, always back up your iPhone before performing a factory reset, to ensure that all of your data is protected and can be restored.
You can simply back up your iPhone to the iCloud using the following steps:
Open the iPhone Settings app and choose your name from the drop-down menu. Afterward, select iCloud and then, under iCloud Backup, select Back up immediately. Alternatively, you may back up your iPhone straight to your PC via iTunes by clicking on the backup button on the device. Now that your iPhone is ready for a factory reset, follow the steps described below to quickly and simply restore your iPhone to factory settings on both your iPhone and your computer in just a few minutes:
This is how you can factory reset your iPhone
Navigate to the iPhone’s Settings app. Select the General tab from the set of possible settings. Scroll down to the bottom of the page and click on the Reset tab. Then select Reset All Content and Settings from the menu bar. A warning window will appear, with the phrase Erase iPhone in red font on it. Simply tap on Erase iPhone and confirm your action by entering your Apple ID password. After 5 minutes, your basic screen set up will display on your iPhone screen.
On a PC, perform a factory reset from the recovery mode.
A USB cable should be used to connect your iPhone to your laptop. Then, simultaneously press and hold the volume up and power buttons until the Apple logo displays. Upon entering recovery mode, the “Connect to iTunes” prompt will show on the iPhone’s screen. After that, simply press the Restore iPhone button, and your iPhone will be restored to its original settings.