Here the source is at the fan/light and a switch loop runs to the wall switch. The source is wired directly to the fan and spliced through to the switch. With this arrangement the light is controlled with the switch and the fan is hardwired for pull-chain control.
In this diagram, two receptacle outlets are wired in the same box with a separate 120 volt source feeding each. Three-wire cable runs into the box. The black and red wires are hot and each is connected to one of the receptacles. The white, neutral wire is splice to each outlet so they share the return path. This is appropriate for standard duplex receptacles, but should not be used for GFCI receptacles. GFCI’s must have dedicated neutral connections to work properly.
This ground fault circuit interrupter wiring diagram of the same device leaves the switch out of the protected circuit. With this arrangement the receptacle is protected but the switch remains outside the circuit. This arrangement can be used to control a light or other device where the extra protection of a gfci is not necessary.
Run the cable through the clamp and tighten it down. Splice the cable wires to the fan wires using a pigtail splice and a wire nut. Connect the ground to the grounding terminal in the connection box and the ground wire from the fan, if there is one.