Turn off the electric to the circuit that powers the ceiling fan. Turn off the actual breaker in your electrical panel, not the switch on the wall.
Locate the ceiling fan speed control switch on the body of the fan. If your fan does not have a light kit installed, this will be the only pull chain switch on the fan. If there is a light kit installed, the ceiling fan speed control switch will be the one closer to the fan blades.
Remove the glass shades and light bulbs from the light kit if your ceiling fan has one. Then, remove the screws that are securing the light kit to the fan. If your fan has no lights, then you only have to remove the bottom cap. This is where all of the wire connections are located for the switch controls. The ceiling fan speed control switch will have either three or four wires coming off of it (depending on your model of fan).
Test for voltage with the touch-type voltage tester.
Remove the screw-on cap that is securing the speed control switch to the body of the fan. Once the cap is removed, the switch will be able to be pulled out of the fan.
Pull the three, or four, wires out of the switch. They are held in place by a pressure clip inside the switch. Twisting them may help them to be released easier, but if you can't get them unseated, you can just cut them. But, before you cut the wires, make a note of which wire is connected to which terminal (write this information down). If you cut the wires, be sure to strip about 3/4 inch of insulation from the ends of each.
Take the new ceiling fan speed control switch and insert the proper wire into its associated terminal slot. If the switch comes with pre-installed wires, then you can simply connect wire to wire using wire connectors.
Remove the screw-on end cap from the new switch and insert the pull chain and threaded nipple through the hole used by the previous switch. Then, secure the speed control switch to the fan body by screwing the end cap back over the pull chain and threaded nipple.
Carefully push all of the wires back inside the fan body and screw the bottom cap/light kit back in place. Install the light bulbs and glass shades.
Turn the circuit back on and test the speeds of your ceiling fan.