1. Turn off the phone first using the power button.
2. When your phone is off press and hold Volumeup button + Home Button + Power Button together for a few seconds until a menu appear.
3. In the System Recovery menu. Select "wipe data/factory reset" by using volume down / up button to navigate and power button to confirm.
4. Select "yes" to confirm.
Before you proceed to this procedure i would like to remind you the risks of this action.
First of all this could not repair the problem on your phone. In this procedure all your files and applications will be wiped out. This includes pictures, videos, apps, documents and other files.
Also after the reset had been done, the application available on your phone will be outdated.
Second it may resolve your phone's problem but after this procedure there will be a
GOOGLE ACCOUNT VERIFICATION. This is one of the phones protection against theft. You should know your official google account and password on that phone. Believe me i had done this on my S5 before and its not easy....specially when you forgot your password.
Lastly there are many factors why a phone freezes. One factor is a phone virus! you should consider scanning your phone first with an updated antivirus software. Second you should first check your phones Storage. Try freeing up some space on your phone drive, i suggest 1gb of free space is a good amount. Transfer some applications on your SD Card to reduce data traffic.
Check your data statistics, the amount of RAM used during a normal phone activity. If the data usage is around 80% of your phone you might want to uninstall some applications.
I suggest you do some research first before going into the reset procedure. I hope this help. Best of luck
!!