Firstly. Turn off the main circuit breaker in the distribution box and make sure it stays off. Unscrew the outer casing of the ceiling switch. If possible retrieve the pull-knob from the broken cord. Depending where it broke, you might be able to re-use the cord, otherwise get some nylon woven cord, pass it through the hole in the bit you unscrewed and fit it to the switch (Usually needs a double knot). Refit the casing, and then, and only then, turn the mains back on.
Jim
January 2011