A metonym is the usage of a related word to represent something.
For example using the term “ride” to refer to a car.
A synecdoche is defined as “a figure of speech that uses a part of something to represent a whole or the whole of something to represent a part.”
An example of a synecdoche is using the word “wheels” to refer to a car. The is a synecdoche because wheels are a part of the larger object being referenced, the car.