You can't if it's stuck in "Activation Lock" and you can't logon to the Apple ID. I have one of these situations. A perfectly good device is effectively bricked.
Well, at some point, they device might as well be bricked.
Otherwise device theft would be much higher (since they could use it, whereas now they can't), plus of course if lost/stolen people would have access to the data.
I wonder how many device are rendered useless due to this "security feature".
Also to note that there is no proving ownership to get around the lock. You either have the password to log in or it’s bricked. You can go to apple or google with proof of purchase and they will not / can not unlock the device.
There are online services which claim to do this if you can prove the ownership.