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 phone located in the battery compartment on a label.
Use Odin with the phone booted into download mode and plugged in. Instructions on how to use Odin and flash firmware on to phone are on every download page of firmware from sammobile.
If you don't need to backup data use Samsung kies with firmware upgrade and initialization OR turn the phone off by taking out the battery for a few seconds and putting it back in.
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 phone from recovery mode.