An idiom is a phrase that has a different meaning from the individual words. You cannot understand an idiom just by translating each word — you need to learn the whole phrase together.
Examples:
Word by word
“Break a leg” → to break your leg
Real meaning
“Break a leg” → good luck!