All of these actions are crucial; start by using iTunes, Finder, or iCloud to "Backup Everything"

To make things easier for resets, "Turn Off iMessage and FaceTime"

The most crucial step is "Turn Off Find My," which prevents "Activation Lock" for future user

After that, go to Settings and select "Factory Reset iPhone," which is easy to get through,

In General > Transfer or Reset iPhone from the menu Erase All Content and Settings, then carry on

To finish the factory reset, you will need to enter your device's passcode

Following that, you can gift or sell your iPhone as you please

Click Here