A literary device is a writing technique that writers use to express ideas, convey meaning, and highlight important themes in a piece of text. A metaphor, for instance, is a famous example of a literary device. These devices serve a wide range of purposes in literature.