An idiom is a group of words with a meaning that cannot be understood by the meanings of the words considered separately. Idioms are often particular to certain groups of people.
When the idiom “break a leg” is used, the actual meaning is different from the words in the phrase. The intent of the idiom is to wish someone good luck, usually in some sort of performance, not to wish someone harm.
For more examples of idioms visit https://idioms.fyi/