You will need to restore the phone. Connect it to iTunes via computer and put in DFU mode. Google it. It's the only way. No other option. You will lose all your data, including photos. You will need your Apple ID and password to set up.
How did you get this phone? I am concerned this is a lost or stolen phone.
IF you don't have appleID and the password you can't make the phone work. Period. Even if you erase it.
The the process is free. The skill level needed is medium.
I set up my mothers iPhone. If she got locked out, she would call me. and she did have an email through a former cable company, that is no longer active. We had to change that. But she wrote her password down with all her other passwords.
I Told her when we set it up the email and password were important.
whenever something requires a password, it's important to remember it.