Resetting your Samsung Galaxy S4 to its factory settings can help you solve many problems, for example, if your handset does not respond or has become very slow. It may also be advisable to reset your terminal if you are going to give it away or sell it.
Note: it is best that you back up your Galaxy S4 before performing this operation, since all your data will be deleted.
How To Restore Factory Setting and Perform a Factory Reset on my Samsung Galaxy S4
From the Home screen, press Apps > Settings > Accounts. In the Back up and reset section, click Back Up my data . In the Personal data section, click Factory data reset:
Press Reset Device and select Erase everything. Your Galaxy S4 will reboot. Wait until the procedure is finished.