Here are my copy and paste instructions:
That is a software issue either one of these should work. If you don't want to lose data, flash downloaded samsung firmware from sammobile with the matching model number of your device located either in the battery compartment on a label or on the back of your device on a label or printed on the back of the device.
How to boot the phone in download mode:
When the phone is off you can do it by holding the volume down + home button + power button until you get the text popping up with the warning message. Then hit the volume up button to boot into that mode.
When searching for firmware on Sammobile:
You can use the CSC code specified in recovery mode to help you choose the right firmware for your device. The CSC code can be used to identify which firmware comes with the carrier (service provider) and/or region that came with your device. You can google this CSC code to find out which region this is but this isn't really necessary, choosing the one that matches the sim card installed or country you are in is good enough.
Use Odin with the device booted into download mode and plugged in. Instructions on how to use Odin and flash firmware onto device are on every download page of firmware from sammobile.
If you don't need to backup data then you can either use Samsung kies (software you can download from samsung) with firmware upgrade and initialization (It will ask for model number of device and serial number of device). If you need to turn the device off you can do so by taking out the battery for a few seconds and putting it back in or holding volume down + power for 8-15 seconds to force shut off. If it's already off, put it in download mode as explained previously before starting the firmware upgrade and initialization if you do decide to choose that.
Or you can use this other method which might not always fix it because the firmware / system software may be corrupted:
Then hold the power, volume up and home buttons until the white Samsung splash text pops up and immediately stop holding the power button and keep holding volume up and home.
Then it will boot into the recovery menu. And you can use the power button to select and vol up and down to select in the menu. Select wipe data factory reset and reboot device from recovery mode.