A metonymy is a special kind of metaphor, in which one thing is used to represent another thing.
In metonymy, (Greek for 'a change of name') the literal term for one thing is applied to another with which it has become closely associated because of a recurrent relation in common experience. Thus "the crown" or "the scepter" can be used to stand for a king and "Hollywood" for the film industry. (Abrams 103)
A special kind of metonymy is a synedoche, which is
A figure of speech... in which (a) the part is used for the whole (A fleet of twenty sail where sail is used for ships), (b) the whole is used for the part (Australia batted where Australia means the Australian Cricket Eleven) (c) the more general for the less general (He was much given to liquor), (d) the abstract for the concrete (When cowardice pursues and valour flies), (e) the material from which something is made for the thing itself (The cricketer wielded the willow with great effect.) (Yelland 202-203)
To think about metonymy and synecdoche, imagine metaphors, without the use of "like" or "as", in which something is not compared to another (such as "The king was as strong as a lion") but one thing is stated to actually mean something else. In this figure of speech, one literal thing is meant, poetically, to stand for another thing. This can be part of the thing, a thing associated with it, the material it's made of, or a general expession of the entire set of a thing to mean certain instances of it. There are several expressions of this type in the play Macbeth, and, in fact, in all of Shakespeare.
One of the easiest forms of metonymy (and, in this case, it is the special form of metonymy called synecdoche) to identify is the use of the material of which something is made to describe an object. Early in the play, in Act I Scene ii, Macbeth is talked about by the Sergeant. "Disdaining fortune, with his brandish'd steel, /Which smoked with bloody execution,(20) ". In this instance, "steel" means Macbeth's sword.
In this same scene, later, a metonymy is used to describe the effect that the presence of the Norwegian army has on the Scots. "From Fife, great King, /Where the Norweyan banners flout the sky/And fan our people cold. " (lines 57-59) In these lines the "banners" of the Norwegian army are not actually making a cold wind which chills the Scots, but the presence of their banners, something closely associated with an army, is what is emotionally chilling to their opponents. This is a combination of two figures of speech, in which personification ("flouting" is something only a person does, a banner merely flaps in the wind, and cannot flout it) and a metonymy of the banners standing for the whole of the army.
Shakespeare enjoyed using this figure of speech -- look for it, especially, in descriptions of people or events, or in long soliloquoys. One that has almost become a "dead" (or, so often used that its metaphorical quality is diluted) is used in Act I Scene iii by Banquo to Macbeth "That, trusted home, /Might yet enkindle you unto the crown,(140)" -- in which "crown" stands for the kingship of Scotland.
Sources: Yelland, H. L., et al., comp. A Handbook of Literary Terms. Boston: The Writer, Inc., 1980.
Abrams, M. H. A Glossary of Literary Terms. Boston: Thomson Wadsworth, 2005.