What do you mean by "unlock"?
1) iCloud: Activation Lock - http://support.apple.com/kb/PH13695 - This is a security feature so only legitimate (i.e., not stolen) redistribution of devices is possible. See: Turn off Find My iPhone Activation Lock - https://support.apple.com/HT201441 - If an activation lock was put on a device, only the owner of the account that applied the lock can remove it. Get them to remove it or return the item for a refund.
2) Device lock: If you forgot the passcode for your iPhone, iPad, or iPod touch, or your device is disabled - https://support.apple.com/HT204306