Wipe out data from your Android device before donating it to someone or selling it over an exchange offer to ensure the new user cannot recreate your information.
Personal information, such as photos, e-mails etc., stored on your phone can be used to steal your identity.
Backup information on your phone
Ensure your data is backed up before wiping out your device. You may backup data to a personal computer using a data cable or backup data to google cloud services.
How to backup to google services?
Go to : Settings > Accounts and Backup> Backup and Restore
You may use the options to backup information to google services or services provided by your manufacturer
Applicable only for phones with Android 6 or earlier. After the backups are complete, it is not enough to wipe out data by resetting factory settings. An unauthorised user might still recover some of our phone data. By encrypting your phone, you will be making data recovery difficult without a password.
Go to: Settings > Security > Encrypt phone
For better insight and a detailed guide, you can follow the steps in the article: Encrypt your Mobile phone.
Remove Accounts from the phone
Remove Google accounts from your phone, as these can be used to identify you or your Gmail address
How? Go to: Settings > Accounts and Sync > Google > Select Account > Remove account
Log out from your Facebook, WhatsApp or banking accounts and delete data from the app.
This will wipe out your phone’s personal and setup data and restore the device to its initial version.
Go to: Settings > Backup & reset > Factory Data Reset > Reset phone