I have heard this from my German friend. I know what it means in English but I don't understand the context in German. They said it's really hard to explain properly.
Is it bad? I hope not.
It basically tells your audience you like drinking Cognac. Whether or not that's bad is for you to decide.
Both "Jäckchen" and "Cognac-chen" are diminutive forms, of "Jacke" (jacket) and "Cognac", respectively. And they rhyme.
Both a jacket and Cognac would warm you up, hence the question about warmth.
The joke is that "Cognac-chen" sounds like a compound of some syllable "Kon" and "Jäckchen", which would make a little Cognac (Kon-Jäckchen) a sort of jacket (Jäckchen).
"The warmest coat is a little drink of Cognac" — well, doesn't seem to make much sense. But that's because the pun is lost in translation.
Of course this is about the "warming" effect (also figuratively, i.e. causing social comfort) of alcohol. For example, if I enter a house as a guest in cold winter weather and they offer me a drink I might thankfully ackknowlegde that with a smile and that saying. It is to mean that I need to warm up from the cold outside and might do so by dressing warm (i.e. keeping my coat on) or I happily prefer to have a drink with my hosts, which is at least as pleasent and helpful.
Cheers, don't drink and drive...
The expression suggests that a drink of high-alchol spirits is the best way to stay warm. We don't have a cute rhyming equivalent in English, but the concept is common: see liquid jacket on the Urban dictionary web site.
Of course we know scientifically that alcohol actually makes you more vulnerable to hypothermia, even as it makes you feel more comfortable, but that doesn't stop years of popular culture and jokes — in German and in English.
This is a pun (German: "Wortwitz"). Whereas admittedly I have never ever heard it in its diminutive form. Also even though it rhymes, the plural form is the one I'm accustomed to:
Die wärmsten Jacken sind die Kognak-en
Where "Kognak" is an allowed spelling of "cognac". It's a pun because it rhymes "Jacken" (plural of jacket/coat, obvious cognate of jacket) with a modified version of "Kognak", appending "-en", because if you were to spell out the German pronunciation in German it would be something like "Konjack" (short "a", hard "k") and therefore fits nicely.