To break a leg is a way of saying good luck in a superstitious way. It does not literally mean to tell somebody to break a leg. This is one idiom that is never used in the field of horse racing!
1. As the sailor set off on his round-the-world voyage, lots of people turned up at the pier to cheer and shout “Break a leg!”.
2. The Indian boxer, unlike his opponents, was always sporting enough to wish them luck and tell them to go break a leg.
3. The jockey was aghast when the novice rider enthusiastically told him to go break a leg.