If you have set up a Google Account, it is important to proceed with the following steps before you make a factory reset. This ensures that all private data will be deleted on the device:
- Go to Settings
- Go to About Phone
- Tap seven times on Build Number, this will activate Developer Mode. Don't panic! The next steps are easy, so no need to worry about breaking anything!
- Go back to Settings and enter Developer Options
- Enable OEM Unlocking
- Back to Settings and enter Backup & Reset
- Select Factory Data Reset and confirm all of the prompts. This will now completely wipe the device.
If you don´t enable the OEM-unlocking, the device will always ask you to sign in with the previously synced Google Account after the restart. This would result in the next user having access to your Google Account.