In Settings

    Scroll down and tap 'General'.

    Scroll all the way down and tap 'Reset'.

    You’ll see a few options. You want to tap 'Erase All Content and Settings'.

    Tap on 'Erase iPhone'. Tap 'Erase iPhone' again (this is a security measure).

    Enter your Apple ID - another security measure.

    Tap 'Erase'.