When your smartphone became unresponsive or sluggish or arose a persistent problem that cannot be solved, a factory reset is your only recourse. You can factory reset your Android phone in emergencies in 3 ways. The standard way of factory resetting your device is by going to your device’s settings menu (Settings -> Backup & Restore -> Factory reset).
However, the standard way of reverting to factory settings does not always work. This is because, the phone manufacturer or your carrier might disable it, or you are using a custom ROM. Alternate method is by using hardware keys. This is useful when you can’t access the settings menu. You can use Volume + Power key combinations, but it differs from device to device.
The third method is by entering a code into the keypad. Just open the dialer and type *2767*3855#. This is useful when your phone has no factory resetting option in the settings.
By just typing the code, your phone will shut down, and when it restarts, the device will be completely wiped with only the operating system and native apps available.
Warning: DO NOT type the code unless you have a specific reason to factory reset your phone. This method does not ask you for confirmation.
For your information, a factory reset or master reset helps you restore your smartphone to its original settings (factory settings) in emergencies. That is, it restores your device to the way it was when you bought it.