The safest way to unlock your phone is to ask your carrier. Since December 2017, major US carriers (Verizon, AT&T, T-Mobile, Sprint) signed an agreement to provide unlocking codes for free, provided you meet specific criteria.
Carrier unlocking removes restrictions that tie a device to a specific cellular network, allowing it to work with SIM cards from other providers. How To Get Back Into Your Locked Phone Fast! how do you unlock a mobile phone