Metonymy - synecdoche
Metonymy and synecdoche are similar. Both figures of speech contrive to use language in definitely non-literal ways. The use of the words is very confused - OED says of synecdoche: "Formerly sometimes used loosely or vaguely, and not infrequently misexplained." Both metonymy and synecdoche refer to our habit of speaking only about one aspect of something, and then using that word to mean all of the thing, not just the part of it that we have named.
Some teachers of English assert that metonymy is "the part for the whole" or using the name of a part of something as a label for it, as 'a bite to eat' may stand for a (light) meal which takes more than one mouthful to consume. Such teachers contrast this with synecdoche, by which they mean "the whole for the part", such as when "The Department thinks ..." sometimes means that the Head of the Department has expressed a preference. This contrast is sometimes reversed. The Concise Oxford Dictionary of Linguistics says of synecdoche: "Figure of speech in which an expression denoting a part is used to refer to a whole: also, in the traditional definition, vice versa."
Other writers say that while synecdoche (pronounced 'sin-EK-dek-y') refers to the part for the whole or the whole for the part, metonymy refers to the use of one aspect - an attribute, or quality - of a phenomenon to represent the whole of that phenomenon. Newsreaders can be heard saying "The White House said today...", when no building spoke; but that building, above all, symbolises all the enormous power of the American presidency.
In other words, the issue of the uses and meanings of these two words is thoroughly confused. If you want to know more, you can see the separate articles on metonymy and synecdoche. If you are studying literature, rhetoric or linguistics, consult your teachers. If you are not a specialist, you are advised to use only the term metonymy, as it is the one that is most widely understood.