Resetting your phone erases all data and brings it back to out-of-the-box condition. This data will be erased from the phone:
Back up your data.
If your phone works and you can unlock it:
Make sure you have your security information:
To restore your data after resetting, you'll need to enter security information. This shows that you or someone you trust did the reset and helps prevent others from using your phone without permission.
If you’re going to give your phone to someone else, disable Factory Reset Protection (FRP):
FRP is security measure that keeps your data safe if your phone is lost or stolen, and that requires logging into the phone with the owner's account to reset the phone. Removing your account and screen lock before the reset lets the person you're giving it to set it up with their own information.
To erase all data and reset your phone:
If you can’t open Settings, do an external reset.
Press the Power button to restart in Recovery mode.
Use Volume buttons to scroll to Yes, then press the Power button to select it.
Allow several seconds for the reset to complete.
Use Volume buttons to scroll to Reboot system now, then press the Power button to select it.
Allow several minutes for the reboot to complete. If the phone doesn't finish rebooting, press & hold the Power button until the screen turns dark, then release it to power up normally.