How to Delete Icloud from activated device

Please can someone help me with my phone is had icloud on my phone is forgot my password and my yahoo account not working any more information can access everything on the phone just can’t change the current account on it