Synecdoche refers to a thing and its parts. The best example is the use of the word “wheel” instead of “car”. As we know, a wheel is a car part.
On the other hand,
metonymy refers to a thing that is very much related to another thing. The
easiest example we can use here is the word “crown” when used in some
literature pieces means power.