Lets assume you bought a second hand iPhone and some how it had an iCloud Lock. In that case you use a third party unlocking service which can help you in Unlocking your iCloud Lock.
Open iPhone IMEI and submit your unlocking request. it does cost around $56
How to Unlock iCloud Lock
Step 1 : Open site mentioned above
Step 2 : Select iPhone Model
Step 3 : Enter IMEI
Step 4 : Submit Request and finalize payment details
Your iPhone will be unlocked in 3 working days.