The two hot wires, the red and black, energized the fan and the light.
Are both these hot? Did you check them with a tester? How was the fan and light turned on? Was there one switch for the light and the fan turned on with the fan pull chain?
Did you write down which color wire was attached to the light(usually a blue wire in the fan)?
At the switch, which color wire goes to the fan(from the switch)?
I find it good practice to understand what wire is doing what before I just disconnect a muli wire device. Usually I would make a diagram and label it. This way you can re construct the original set up to figure out the solution to the puzzle.
Just slapping wires together is not the way to work with electricity. You really need to understand the path of the currents flow.
Ron