Foreshadowing

Foreshadowing is a plot device that suggests what might happen later in the story. This is often done to add suspense or help the audience understand where the plot is going. Foreshadowing is often necessary to avoid awkward plot development, which could result in deus ex machina.

Foreshadowing is often used to justify the inclusion of certain elements of a story that might otherwise seem unnecessary (Chekhov's Gun).

Chekhov's Gun
Chekhov's Gun is a specific type of foreshadowing in which a seemingly insignificant thing is introduced early in a story and gains significance later on. It is named after the author Anton Chekhov, who said, "If you say in the first chapter that there is a rifle hanging on the wall, in the second or third chapter it absolutely must go off. If it's not going to be fired, it shouldn't be hanging there." This approach to storytelling argues in favor of introducing only necessary elements to the plot so as not to distract the reader.

Note that Chekhov's Gun doesn't have to be a gun. It can be a sword, a letter, jewelry, an animal, a person, or pretty much anything else.

Red Herring
A red herring is a plot device which intentionally leads the audience astray in order to build suspense and intensify mystery and surprise. For example, in a murder mystery the victim might have fired his butler just prior to his death, causing the audience to incorrectly guess that the butler is the murderer.

While similar, this should not be confused with the logical fallacy of the same name.