You want to restore the original configuration of your smartphone before gifting or selling it?
Note, however, that the reset will erase all your data, apps, and settings. You should therefore proceed with caution and back them up elsewhere if necessary.
Resetting an Android phone
Backup your data.
To ensure that no data is lost during the reset, be sure to back up your data. Go to Settings -> Advanced settings (or “System”) -> Backup and reset. Select the data you want to back up.
Format your phone
Still in Backup and reset, click on Reset all settings (“Restore factory settings” on some devices). Enter your PIN code and confirm the formatting of your smartphone.
Note: The exact location of the backup and reset settings may vary from phone to phone. The following instructions apply to the most common configuration.
Resetting an iPhone
Back up your data.
Go to Settings -> your name -> iCloud -> iCloud Backup. Click the option “Back up Now”.
Configure your iPhone
Format your iPhone. You will be prompted to enter your code to confirm the reset.
Attention: Formatting is an irreversible action. Data that has not been backed up cannot be recovered.