A synecdoche is a figure of speech in which a part of something is used to represent the whole, or vice versa. For example, saying "all hands on deck" uses "hands" to refer to the sailors themselves. This literary device helps create vivid imagery and can convey deeper meanings in both poetry and everyday language.