Which lock do you actually have?
Pick the message you see. Each one goes to a different guide, because each lock has a different official answer — and buying the wrong “unlock” is how people lose money.
It asks for someone else's Apple ID after a reset
That is Activation Lock. Go to the Activation Lock guide — or, if you are requesting it from Apple, the Apple Support removal guide.
It says “SIM Not Supported” with another carrier's SIM
That is a carrier lock. Go to the carrier unlock guide.
It says “iPhone Unavailable” or you forgot the passcode
That is a passcode lockout. Go to the Unavailable guide.
It shows a company or school management screen at setup
That is MDM enrolment. Go to the MDM guide — only that organisation's administrator can remove it.
You cannot sign in to your Apple Account at all
That is an account problem, not a phone lock. Go to Apple Account recovery, or read unlocking an Apple ID without a password.
You are about to buy a used iPhone
Do not pay first. Run the used iPhone checklist and check the model number before money changes hands.
A site promises a free online unlock
Read this first: what free online unlock services actually do, and how to spot a fake tool.