In this quick guide, we'll treat how to flash, format or reset an Android phone to factory state. there are two methods you could use:
Method 1 (Settings)
1. Go to Settings
2. Select 'Backup and Reset'
3. Click 'Factory Data Reset'
4. Confirm by clicking Yes or confirming your wish to reset to factory state
5. Your phone should reboot after some time and its done
Method 2 (Recovery mode)
1. Boot into recovery mode (Google the specific method for your phone's brand but generally; Switch off the phone > hold down the volume increase button > hold down the power button > keep holding down both till your phone boots into recovery mode)
2. Select Wipe data / factory reset
3. Click Yes to confirm
4. Click Reboot now after data wipe is complete or remove the battery > slot the battery back in > boot the phone