Metonymy refers to a thing by the name of something associated with it. Synecdoche refers to a thing by the name of something that is part of it, OR something that it is part of.