How to log off of someone's iCloud on a used iPhone?

My cousin got me a use iPhone 4, but the iCloud of the last person who used it didn't log out. I tried to erase everything but I need the password. How can I do that without the password, if that's possible?

If you dig deep enough in settings, you will fine REST - and then you need to rest the entire phone. This *should* wipe out all info, including all passwords. However, since most places that BUY used cellphones say you MUST disable *Find My Phone* first - it is remotely possible that this will NOT work - think about the implications. So - find the friend of friend that owned this - and ask THEM to give you the unlock code. Of course, is anywhere in that chain, if something came to you NOT legally - this could be sticky to do.