The safest, cheapest method is requesting an unlock from your current carrier. If they say no, a paid IMEI-based service is the next best bet. Avoid software "hacks" and free tools that sound too good to be true.
It is more secure than a generic "security question" (which can be socially engineered by strangers) because it relies on real-time human verification from trusted individuals. how to unlock a mobile
Log in to the Google Find My Device website from another computer. If enabled, you can remotely lock the device with a new temporary password. The safest, cheapest method is requesting an unlock
iPhones cannot be unlocked by entering a code. Instead, the carrier sends a request to Apple’s servers. When you restore or update iOS with a non-carrier SIM, Apple unlocks it remotely. It is more secure than a generic "security
Security features screen-lock the device for privacy. 2. Unlock Your Carrier Network (Free & Legal)