Make sure the box is rated for a ceiling fan. Locate the switch cable which must be glued through the top or side of the box that serves the fan or the light.

How To Wire Ceiling Fan With Light Switch
Wiring a ceiling fan with one switch. Connect the black wire from the ceiling to the black wire from the receiver. Using wire strippers peel an inch of insulation from the end of the black and white wires. This will allow you to control your fan and lights with a single switch. Connect the black fan cable together with the black light wire and the black switch wire and cover them. Connect the three grounding wires green greenyellow stripe or bare copper coming from the ceiling fan rated electrical box the downrod attached to your fan and the ceiling bracket. You can install a ceiling fan with a light in a room with a single light switch with a simple wiring trick.
Connect the black and blue wires coming out of your fan. Connect the greencopper wires together. Connect the red wire from the fan to the other terminal on the fan switch and the black wire to the light switch. If youre replacing an old fan or light fixture and the wiring in the fixture box contains only two or three wires black white and green or bare copper you must use single switch wiring for the new fan. Just type lsailor1 in the youtube search bar. Make a pigtail of the ground wire using two 6 inch lengths of bare wire and connect one ground wire to the fan switch and one to the light switch.
Second remove the light fixture in the room. First turn off power to the fixture at the electrical panel. Switched lines and neutral connect to a 3 wire cable that travels to the lightfan outlet box in the ceiling. Connect the three white wires from the ceiling fan and receiver together. Wiring a ceiling fan switch loop use this wiring when the source is at the fixture and you want to control the feed to both components with the same switch. Three wire cable runs from the fan to the switch box and the source neutral is spliced to the white wire and to the fan neutral.
Connect the black and blue wires in your fan if you only have 1 switch. The fan control switch usually connects to the black wire and the light kit switch to the red wire of the 3 way cable. Twist the copper ends of the black and blue wires together like you did with the previous wires. You might also like other videos of mine. Wiring ceiling fan and light with one switch this method allows you to turn on the fan and the light from one single wall switch cutting out the necessity to use the pull chain every time you want to adjust the fan. Twist all the white wires in the box together and cap them.
Ceiling fan switch wiring diagram 2 line voltage enters the switch outlet box and the line wire connects to each switch. This video describes an easy way to replace a 3 speed ceiling switch. Double switch wiring requires a circuit with four wires black red white and greenbare copper. Connect white wires together.