Are you talking about unlocking it from a provider? How to unlock your iPhone for use with a different carrier - Apple Support
Are you talking about you have forgotten the passcode on your iPhone? If you forgot the passcode for your iPhone, iPad, or iPod touch, or your device is disabled - Apple Support
Are you talking about an Activation Lock? Find My iPhone Activation Lock - Apple Support