If you mean it's locked with a passcode and you don't remember the passcode, I'm afraid your only option is to restore it with a "fresh" iOS. There really is no way to circumvent that passcode. Hopefully, you've got a recent backup so you can use it during the restore. But, the only way to get access to your phone is to wipe it and start again.
Sorry.
Marilyn