Is it legal to unlock an iPhone?
If your phone is older than three years, it might be locked to a particular provider. The phone may be locked if it’s tied to a different network. It’s completely legal to unlock an iPhone if you’ve finished paying for your contract.
How to unlock an iPhone if you’ve forgotten your passcode:
The most common reason for this is just after buying a new phone, iPhone users often forget their passcodes. The good news in such an instance is that there often isn’t too much information to lose at this point. Try your best to trace your steps and go back to places where you were most likely to enter your passcode. In this way, it’s hoped that your muscle memory will trigger your memory.
If that still doesn’t work, get in touch with your carrier to find out the next steps for unlocking your iPhone.
If you can’t remember the passcode, keep in mind that you will need to restore your device using the computer with which you last synced it.
Before requesting Apple representatives to unlock your iPhone, make sure that you have backed up the content on your phone.
Keep in mind that Apple reps cannot unlock an iPhone for you without restoring the phone.
The process for unlocking an iPhone according to Apple:
Your cellphone network will need to process your unlock request. Then you need to ensure that you back up, erase and restore your iPhone to unlock it.
This might take a few days to complete.
Remove your SIM card and insert the new SIM card.
Complete the setup process.
If you don’t have another SIM, do the following:
When you have a backup, erase the phone.
Restore your iPhone from the backup you just made.