Follow these steps to reset the Android device to factory settings:
Secure your personal information that is not automatically backed up to Google. If you have not changed the presets, e.g. Phone contacts and calendar entries automatically backed up and linked to your Google Account. WhatsApp messages, photos and videos can also be backed up by Google Drive every 24 hours, but only if you have explicitly agreed. Of course you can also transfer all data to your computer via USB.
Remove the SD Memory Card if one is inserted.
Open the settings of your smartphone.
In the "PERSONAL" tab, press the option "BACKUP & RESET".
Press "FACTORY DATA RESET"
Press "RESET PHONE"
Press "ERASE EVERYTHING"
Your device will now be reset to factory settings and then automatically restarted. This process can take several minutes. Please note that during this process the corresponding Google Account with the associated password is requested.