Break a leg is a phrase that is usually used in reference to theatre to wish luck to performers.
This is a tough one since there are several origin stories and nobody agrees on one story being the sole source of origin.
In theatres, a “leg line” drawn on either side of the stage marks the point beyond which actors would be visible to the audience. If an actor did not get to cross the leg line during a performance, he/she would not get paid. Break a leg was a wish for the actor to get on the stage, so they would get paid.
Another origin story goes that during Elizabethan times, the audience would bang their chairs on the ground instead of applauding by clapping. If they banged the chair really hard, the leg would break.
There is another etymological origin theory which says this comes from German - the origins are suggested to have arrived from a loan translation of the German phrase “Hals- und Beinbruch,” which literally means “neck and leg break.” That phrase itself was a humorous interpretation of the Yiddish phrase “Hatsloche un broche,” which literally translates to “success and blessing.” The similar pronunciations of these phrases may have been the start of an ironic well-wishing.