This wiring diagram illustrates the connections for dual controls, a speed controller for the fan and a dimmer for the lights. The source is at the controllers and the input of each is spliced to the black source wire with a pigtail. From the controllers, 3-wire cable runs to the ceiling outlet box.
The black wire is splice to the output on the speed controller and to the black, fan wire at the other end. The red wire is spliced to the output on the dimmer and to the blue, light wire at the other end. The neutral from the source is spliced in the switch box with the white wire, and to the neutral wire on the ceiling fixture at the other end.
To wire an exhaust fan to a wall switch, use this diagram. These fans usually come with a small electrical connection box welded to the side of the housing. There will be a cover on the connection box that fastens with a small screw. Open it, pop the plug out of one of the wire holes and thread a wire clamp into it.
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.