Hi try this or look under the iPhone support page by apple:
Method 1. (iDevice)
- Log into iCloud on your iCloud device.
- If your transferring the device follow step 3 to make it easier later on.
- Goto setting>iCloud>Find My>Find my iPad/iPhone And turn off find my.
- Open settings>General>Reset and press your reset option
- Follow the onscreen prompts
Method 2. (3rd Party Reset)
- Make sure you have the required items to complete this
- Your idevice Pin/Password
- Your Device ICloud account username/password
- A lighting or type C cable (The device charging cable)
- A Window or Mac laptop/PC
2.Plug your device into your pc/laptop and trust it on your idevice
3.On windows install iTunes from the windows store ONLY
4.Open iTunes on window or goto finder on your mac
5.Find your idevice
6.Press the restore button and follow the onscreen prompts