Can i icloud unlock an iphone?

I want to buy an iphone second hand off someone but they said its icloud locked. I know that you can unlock that but i was wondering if it actually works. Like if there's gonna be a problem or sometehing.

Yes it's going to be a problem. You CAN'T unlock it without the Apple ID and password that it is associated with.

The icloud lock is the basic anti-theft system, so a stolen phone is worthless.

It is totally impossible to genuinely bypass - and as it's likely stolen you would be handling stolen property and could be arrested for simply being in possession of it.

Don't touch that hot potato. The rightful owner will be able to unlock the phone for you before you buy it.

Don't bother buying an iCloud locked iPhone. You can only do that with the owner's Apple ID & password & if the seller for some reason can't provide that then the phone is likely lost or stolen.

Log in your own Apple ID, problem solved. When you get a second iPhone, first reset it to erase its all data, then set up it again.