To unlock your iPhone 5, you can follow these steps:
1. Install the latest version of iTunes.
2. Make sure the latest version of your iPhone is updated by official iTunes.
3. Connect the phone to iTunes with a non-accepted sim card.
4. Wait until iTunes detects your phone.
5. Disconnect the phone and reconnect after 10 seconds.
6. Your iPhone 5 is now unlocked.
Alternatively, you can swipe up from the bottom of the Lock screen (iPhone X and later) or press the Home button (other models) and enter the passcode.