These two terms, connotation and idiom, aren't actually related in meaning. Often, connotation and denotation are held up as words that are close in meaning and similar-sounding, but ultimately, different. The denotation of a word is its dictionary definition, while the connotation of a word is more vague and has more to do with what the word suggests rather than the actual meaning of the word.
An idiom is a phrase that is outside of formal expression or diction. Idioms are often unique to a particular culture, and the words used in an idiom often have nothing to do with the meaning of the phrase. A good example of an idiom is the phrase "to kick the bucket" which means "to die." Buckets and the act of kicking have little to do with death, but for some reason, this phrase is meant to be a gentler way of referring to the act of dying. Idioms are also sometimes compared to slang, which is another kind of informal word or phrase.