light stays on after installing new fixture

the description of your situation is confusing.

two cables might go to a ceiling box if it was controlled by two switches or two locations are being controlled (like two ceiling lights). or a fan switch and a light switch could be wired with two cables (not how i would do it).

if it was a switch loop like engineer_comp_geek mentioned then it would trip the breaker when that switch was closed, if it was miswired.

is there a wall switch for the fan that is separate from the wall switch for the light?

it is good and essential to put a tape label on the wires before you disconnect it.