The previous owner needs to log out of iCloud or go to https://www.icloud.com/find/ and erase the device, then remove it from their account. If they can't do that, the device is useless. Apple won't unlock it.
Turn off Activation Lock - Apple Support.
See if they can recover the ID/password. Use every email address they can think of.
Apple ID - How to find your Apple An iCloud e-mail address is an Apple ID.
Apple ID - Find
For the Apple ID password, enter the Apple (iCloud) ID and click Forgot Password. See if they can get an email option if necessary.
Apple ID - Manage
Apple ID – Forgot Password