Tap "Erase [device name]" and repeat the step to confirm that you do, indeed, want to wipe the device. Now, enter your Apple ID to log the device out of your Apple account, and after entering the password, tap on the "Erase [device name]" option one last time to wipe all of the data and reset the phone to its factory default state.