Process to completely reset an iPhone
STEP A if phone NETWORK LOCKED
Contact your network provider and ask for an unlock (May be be network sim locked ) = Pay appropriate fee if necessary . Follow steps and any texts from Network carrier accurately.This could take several days to complete.
STEPS to full reset your iPhone after its unlocked
Tap settings / Apple ID (Normally your name at the top of the screen)
Scroll down to Find My - tap on the next screen TURN OFF - Find My phone: Find my Network and Send last location you will be asked for your Apple ID password and tap TURN OFF .
Next tap back APPLE ID screen and scroll down to sign Out its red at the bottom tap that .
Your phone is now logged out of your Apple services .
Now scroll back to Settings - Tap General - Tap Transfer or Reset iPhone then erase all content and settings - the phone will then factory reset and you can shut down
The next boot of the iPhone will be at the Hello screen ready to setup as a new phone .