Two things can be happening when you can't pull the chain on your ceiling fan light switch. The first is that the chain got stuck somewhere inside the fan housing, and the second is that the spring-loaded switch mechanism broke. Either way, the chain can't retract, and the switch can't reset. You have to remove the canopy cover from the fan to determine the problem; to get the lights working again, you may have to replace the switch.
Removing the Fan Canopy
Turn off the power by flipping off the breaker in the main panel that controls the fan. Don't rely on simply turning off the wall switch -- someone could turn it on by mistake while you're working.
Position a stepladder under the fan. The ladder should be tall enough for you to work comfortably from the second-highest rung.
Climb the ladder and remove all the light bulbs. If your fixture has a glass dome, you must remove it before you can access the bulbs. Once the bulbs are out, remove any glass bulb covers to avoid breaking them if the canopy should fall.
Unscrew the screws holding the canopy using a screwdriver. There may be three or four at regular intervals around the sides of the canopy. Pull the canopy down to expose the wiring.
Chain Repair and Switch Replacement
If the pull chain for the light switch is simply stuck on something inside the canopy, you should be able to free it once you've removed the cover. After rearranging wires to ensure the chain doesn't stick again, your job is done. Reassemble the canopy and light covers, screw in the bulbs, replace the dome, and turn on the power.
If the chain isn't stuck, locate the switch by following the chain to its end. The switch itself is probably defective, and since it's usually an inexpensive part, the most efficient course of action is to replace it.
Switch Replacement Procedure
Take a picture of the switch with a digital camera. You can use this as reference if you forget where the wires go when installing the new switch.
Unscrew the nut holding the switch to the canopy, using your fingers, and pull the switch away from the canopy.
Disconnect the switch by snipping the two black wires attached to it as close to the switch as possible, using wire snips. Take the switch to a lighting supply store -- or a hardware store -- and purchase an exact replacement.
Splice the new switch onto the existing wires by stripping wire ends -- using wire strippers or a utility knife -- and twisting wires together. Cap each pair of wires with a screw-on wire connector.
Feed the chain through the hole in the side of the canopy, insert the switch connector through the hole and screw on the nut to secure the switch in place.
Reassemble the canopy, replace the bulbs, turn on the power and test the lights.