Hello
That defers from phone model to model.
- Some phones requires a simple hard reset using a combinations of buttons to get into recovery mode where factory data reset can be performed.
- Some requires a master reset code
- Some requires flashing the phone's firmware using a certain tool and or software.
Please comment your phone model number below so we can be able to batter assist you.