You fit a new cord - and depending on where the break is you tie it on inside the switch housing or just below it.
Sometimes the switch housing has been painted over making it difficult to unscrew the cover. In these circumstances it becomes necessary to smash your way in - requiring a new switch.
DIY stores sell pull-cords and switches. The staff there will be only too pleased to advise you.
Isolate (turn off) the electrical circuit before starting work.
If you have to replace the switch and are not confident then engage an electrician - remember Lord Finchley...
Lord Finchley tried to mend the Electric Light
Himself. It struck him dead: And serve him right!
It is the business of the wealthy man
To give employment to the artisan.
Hilaire Belloc
Peccavi
January 2013