Depending on how they are connected at the switches depends on which one you connect the fan or the light at the ceiling. Split the incoming hot wire into a y and connect it to a terminal on each switch.
Wiring Your Home How To Wire Light Fixtures
Can you connect red wire to black. Its possible to link two red wires together or a red wire to a black wire. In 220 volt circuits red wires are the secondary live wires. Connect the black jumper wire to the top terminal screw on the switch and now both the switch and the top receptacle in the split tab outlet have power. Connect black fan wire to the black ceiling wire. One is for the fan and the other is for the light. If the red and black wires are connected together already and energized yes you can do that but you will need a pull chain light or a remote control if they are not switch controlled.
Connect the red wire to the screw in switch 2. Connect the red wire coming from the outlet to the bottom switch terminal and now the lower receptacle on the split tab outlet will get power only when the switch is on. Connect the black wire to the screw located in swith 1. If you have two switches to control the fan then black and red are the two wires from the two switches. Ceiling fans can use two hot wires. Connect the white wires together.
In addition red wires are used to connect hardwired smoke detectors to the homes power system. In the switch box. If you want the red and blue will have the switch only control the light and the fan will work on the pull chain independantly if left connected black to black. Like black wires they can also be used in some types of switch legs. Connect white wires together. Connect the blue wire to the red wire.
Connect the box red wire to both the black and blue fan wires and both will work off the switch.