A metaphor is a figure that describes an object or action in a way that is not literally true, but helps to create an idea of something or make a comparison. A simile is used when a comparison is to be made, where a particular object or action is compared with something with the word "like" or "as", which in the case of a metaphor is not used.
"He is as fast as lightning" is an example of a simile, while "he is a lightning" is an example of a metaphor.
Examples are: metaphor, simile, alliteration, hyperbole, allegory etc. In contrast to Literary Elements, Literary Techniques are not unavoidable aspect of literary works.