How to distinguish between "metaphor" and "metonymy"?

The differences are as follows:

Metaphor: A rhetorical device that makes a hidden comparison. Metaphor is also called metaphor. A metaphor is a metaphor that uses one thing to imply another thing. Metaphor is a way of transforming unknown things into known terms for communication. For example, the metaphor "a car moves like a beetle" assumes that we don't know how the car moves, but we do know what the beetle looks like as it scurries across the ground. This metaphor transforms the characteristics of a beetle into the characteristics of a car.

Metonymy: a metaphor that reflects the existence of a certain correlation between two types of real phenomena. This correlation often appears and is fixed in people's minds, so words that refer to type A phenomena can be used to describe it. Refers to Category B phenomenon.

Metonymy means that when thing A is not similar to thing B, but there is a close relationship, this relationship can be used to replace thing A with the name of thing B. Such a Rhetorical device. The point of metonymy is not "similarity"; it is "association". Metonymy is also called metonymy, metonymy or metonymy. I am reading Lu Hsun. I am reading Lu Xun's works. (We use Lu Hsun to represent Lu Hsun's works)

Metaphor and metonymy are two basic modes of communicating meaning. He insisted that metaphorical patterns have poetic characteristics. It also has the characteristics of advertising, in which imagination is generated from known cultural myths, and the characteristics of myths are transformed and endowed with unknown products. The wild west became a metaphor for a brand of cigarettes, and the bright sunshine of San Francisco became a metaphor for a brand of cosmetics. Metonymy, also known as metonymy, is a rhetorical method in which one word or phrase is replaced by another word or phrase that is closely related to it; a metaphor that reflects the existence of a certain correlation between two types of real phenomena. This correlation It often appears and is fixed in people's minds, so the words used to refer to Category A phenomena can be used to refer to Category B phenomena.