To unlock your iPhone, follow the steps described in the Apple article:
(< iOS 15.2) -> If you forgot your iPhone passcode
If you forgot your iPhone passcode - Apple Support
(iOS 15.2 and newer) you don’t need to have a computer -> If you see an iPhone or iPad unavailable message or Security Lockout screen
If you see an iPhone or iPad unavailable message or Security Lockout screen - Apple Support
-----
Have you forgotten your Apple ID?, Check your Apple ID via your email box, see this Apple article: If you forgot your Apple ID
If you forgot your Apple ID email address or phone number - Apple Support
OR see -> Having trouble signing in?
https://iforgot.apple.com/password/verify/appleid
See -> If you can't connect or sign in to iCloud
If you can't connect or sign in to iCloud - Apple Support
-----
Have you forgotten your Apple ID password? -> See this Apple article: If you forgot your Apple ID password
If you forgot your Apple ID password - Apple Support
Then see this Apple article: What to do after you change your Apple ID or password
What to do after you change your Apple ID or password - Apple Support