Foreshadowing

Foreshadowing is a narrative device in which a storyteller gives an advance hint of what is to come later in the story. Foreshadowing often appears at the beginning of a story, and it helps develop or subvert the audience's expectations about upcoming events.
The writer may implement foreshadowing in many different ways such as character dialogues, plot events, and changes in setting. Even the title of a work or a chapter can act as a clue that suggests what is going to happen. Foreshadowing in fiction creates an atmosphere of suspense in a story so that the readers are interested and want to know more.
The literary device is generally used to build anticipation in the minds of readers about what might happen next to add dramatic tension to a story. Moreover, foreshadowing can make extraordinary and bizarre events appear credible, and some events are predicted so that the audience feel that it anticipated them.
Hints may be about future events, character revelations, and plot twists to create mood, convey theme, and build suspense, usually to hint the good events that will likely cross paths or happen to the main character later on.
Plot can be delayed by situations or events to give the impression that something momentous will occur to build anticipation and emphasize importance to them, which gives the audience a series of questions, particularly after cliffhangers.
The literary device is frequently adapted for use by composers of theatrical music, in the composition of operas, musicals, radio, films, television, gaming, podcasts, and internet scores and underscores, and incidental music for spoken theatrical productions.
Methods
Foreshadowing can be accomplished by the use of story-driven or fictional events which can bring original dialogue, emotional investment in the plot, such as for the main character, unknown and present characters.
A flashback is the interruption of a sequential narrative plot to present important events that have happened in the past to present plot points that are difficult to bring into the narrative, such as character traits, events, or themes which may drive the current narrative or to be revealed.
Flashforwards move the plot forward in time where formerly revealed or new character traits, events or themes are brought into the story. They might embellish past or current plot points.
Related concepts
Foreshadowing is often confused with other literary devices.
A red herring is a hint designed to mislead the audience. Foreshadowing only hints at a possible outcome within the confinement of a narrative and leads readers in the right direction.
A flashforward is a scene that takes the narrative forward in time from the current point of the story in literature, film, television, or other media. Foreshadowing is sometimes employed through characters' explicitly predicting the future. Flashforwards have scenes shown out of chronological order in a nonlinear narrative, with chronology in an anachronist order, such as to make the reader or the audience think about the climax or reveals.
Chekhov's gun dictates that everything superfluous must be deleted. In relation to foreshadowing, the literary critic Gary Morson describes its opposite, sideshadowing. Found notably in the epic novels of Leo Tolstoy and Fyodor Dostoevsky, sideshadowing is the practice of including scenes that turn out to have no relevance to the plot. That, according to Morson, increases the verisimilitude of the fiction because the audience knows that in real life, unlike in novels, most events are in fact inconsequential. The "sense of structurelessness" invites the audience to "interpret and question the events that actually do come to pass."
References
Fiction
Narrative techniques