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
-----
See this Apple article: How to unlock your iPhone for use with a different carrier
How to unlock your iPhone for use with a different carrier - Apple Support
- Apple can't unlock your iPhone for use with a different carrier. Only your carrier can unlock your iPhone.
You need to contact your Carrier.
Or do you need the PUK code?, See this Apple article: Use a SIM PIN for your iPhone or iPad
Use a SIM PIN for your iPhone or iPad - Apple Support