Follow below steps to fix your phone:
The process is the same to all Galaxy devices, changes only the version of the firmware you need to download.
Backup important data, because this process may remove it.
Close Samsung Kies, disable Antivirus software and Disconnect all devices that are connected to your computer.
3. Boot your device in Download mode
Turn it off then press the Volume down key, Home and Power button together and hold them until you see that the device booted in Download mode. Then press Volume up key to continue.
4. Connect you Galaxy device using a USB cable to the computer. Wait until you get a sign in Odin (ID: COM section). Make sure nothing is checked except: Auto Reboot, Reset Time and the PDA checkbox which we set earlier.
5. Make sure your phone wouldn’t get disconnected in the middle of the next process. Click the Start button and wait a few minutes until you see the message PASS on a green background.
You are done. Your device should work now.