To erase all data from iPhone and restore it to factory settings, you can use a tool found in Settings. Here's how to do it
When selling, gifting or trading in with the Apple Trade In service, it's good and right to delete all data on the iPhone. This is a useful and fundamental procedure to prevent all the information contained on the smartphone from falling into the wrong hands, jeopardizing our personal safety. But how to do this procedure? First of all, you need to make a backup of your data by transferring them to an external hard drive or, even better, by using the service offered by iCloud. Once you have made a backup of all the data on your iPhone, you can proceed to delete it from the smartphone. Apple allows you to do this directly from the smartphone's settings without having to use ad hoc programs
How to delete data from iPhone
After backing up your iPhone data, you can proceed to delete all the data. The procedure to do is quite simple and will take you little time.
First you need to open the "Settings", click on "General" and scroll down to the "Restore" item. Here you can select the "Initialize content and settings" option. After entering the numeric code, the device itself will ask you to update the backup using iCloud before proceeding with the device reset. This is an important tool that allows you to save the contents of the iPhone even at the last moment before proceeding with a full reset. The system will ask the user for a confirmation before initiating the data deletion after clicking on the "Delete Now" option.
At this point you will need to enter the unlock code again, this is the last chance to abort the procedure in case you changed your mind at the last moment. Clicking on the "Delete iPhone" option will delete all the data and personal information on the device, resetting it permanently. After that, you can resell, give away or trade-in your iPhone with peace of mind.