Check the fan circuit power supply is off. Tag or mark the breaker to avoid inadvertent energizing of the circuit.
Test the tips of the black hot and white neutral power supply wires with a voltage tester to verify no power exists in the circuit.
Strip 1/2-inch of insulation from each of the colored wires using wire strippers.
Connect the green ground wire from the fan to the bare copper ground wire from the switch pigtail using a wire nut. Tighten the nut clockwise with your hand.
Connect the white wire from the fan to the white neutral wire from the power supply with a wire nut. Ensure no part of the copper conductor is exposed below the nut.
Connect the black wire from the fan to the black hot wire pigtail from the switch with a wire nut.
Connect the blue wire from the fan to the red wire from the switch using a wire nut.
Wrap each wire nut connection with electrical tape. Wind the tape clockwise in overlapping layers from the wire nut over the wires.
Complete ceiling fan installation according to manufacturer's instructions.
Restore electrical power to the fan circuit.