If your ceiling fan or the light on the fan doesn't work when the chain is pulled, then the problem is most likely a broken fan pull chain switch. The switch will also need to be replaced if the chain will not pull down or if it broke off inside the fan housing. Although you could call a professional to repair your fan, replacing the pull chain is fairly easy and could save you a lot of money.
Open the Fan Housing
First, turn off your power at the breaker, then use a ladder to get where you can easily access the inside of the fan housing. Next, figure out how to unscrew the housing for your fan because each model is a little different. Some will require you to remove the lights and their covers first, while others do not. Be sure to have a surface on your ladder ready to set the bottom of the housing down on as most of these are attached with a few wires to the rest of the fan. It is easier to set this piece down a few inches away from the fan and work like this without taking everything apart. If you must disconnect the wires, use a non-contact voltage tester to ensure the power is off. Also, take a picture of the wire connections before disconnecting anything so you can reassemble the fan properly later.
Locate the Pull Switch
Figure out where the broken fan pull goes into the housing. In many units, the light pull goes in through the bottom and the fan chain goes in through the side, but this is not true for all fans. Before touching any wires, use a non-contact voltage tester if you have not already to make sure the power has been properly turned off. Next, double check that all the wires are properly connected. Although you usually will need to replace the pull switch when you are having problems getting your fan or light to turn, it is always possible that a faulty connection is to blame.
If the wires all seem to be connected properly, see if the pull switch has two or three wires, then take a picture of the unit before visiting your local home improvement store to buy a new one. Most units use a standard two or three wire assembly, but also have your fan's brand, model number, wattage and a photo of your pull switch available in case you need this information. Generally speaking, the most important thing to know before buying a pull switch is whether you need one with two or three wires. Do not buy one before opening your fan unless you buy one of each and plan to return the one you do not use.
Remove and Replace the Chain Pull Switch
Leaving the pull switch in place until you have a replacement ready makes it easier to swap out the old switch for the new one. Remove the existing unit by unscrewing the nut that holds it in place. Take one of the wires attached to the pull switch and disconnect it, either by removing the twist connector and then separating the wires that have been twisted together or by cutting the wires if they were crimped together. Then, reattach the same wire from your replacement pull switch, which may require stripping the last 1 inch at the end of the wire. Cover the exposed wires with a twist connector, then do the same process with the remaining one or two wires.
Finally, bolt in the new fan pull switch and reassemble the fan. Turn on your breaker again and check to see if your repair worked. If the new fan chain pull switch did not fix the problem, you should hire a professional to diagnose and repair the problem with your fan.