This is a typical wiring setup for a 3 way light switch with black white red and ground wires. I also have a post about a red wire in a light switch if you need that information.
Found Odd Light Fixture Wiring Question Doityourself Com
Red black and white wires ceiling light. If it doesnt work switch the lower wires. The cable has a black wire which connects directly to the circuit and a red wire which connects to the switch. Black wire is for the fan. White wire is neutral. If you only have black wires in your box connect both the non white wires from the fan to the black wires in the box. Black wires always signify the positive or hot leg of the current while white wires signify negative also called neutral or return.
Then the red wire in your box goes to the non white wire on your ceiling fan which is often blue. I am installing a ceiling fan that has white black red and ground wires. A three way switch is different. Typically a ceiling fan is wired so the fan motor has power all the time by the black wire and the light of the ceiling fan is controlled by the wall switch through the red wire. This type of switch lets you turn the light off or on from more than one place in the room. Ceiling fixtures almost always have a black and white wire.
When there is a separate red and black wire in the ceiling fan box this usually means that one of the wires is controlled by a wall switch. The black wire goes to the bundle of black wires. The fan has a light attached. Red wire is sometimes included and acts as a conductor to carry power to the light kit. Green wire is for the ground. Sheathed cable with a red.
Place the ceiling fan motor on the floor and position the canopy on top of the motor feeding the. When there is an extra hot wire it is red. Some sheathed cable includes a fourth red wire which makes it useful for wiring fixtures with three way switches or a ceiling fan with separate light and fan switches. The wires coming out the ceiling are black white and ground. The white wires on the fan go to the bundle of white wires. I cannot get both the light and fan to work at the same time.
What if youre installing a ceiling fan. Ground wires are either left bare or covered with green insulation. Feed the black white red and copper wires through the hole in the center of the mounting plate. If you had a red wire coming from your ceiling it is hooked up to your wall switch. The wall switch is located near the bedroom door and controlled the light fixture i replaced with the fan. The ground wire also connects to the switch but the white wire gets spliced to the circuit neutral wire and bypasses the switch.
Blue wire is for the light if light is included with the fan.