Foreshadowing

In this Arthur Rackham illustration, the Rhinemaidens warn Siegfried of a curse, foreshadowing the disasters of Götterdämmerung.

Foreshadowing or guessing ahead is a literary device by which an author hints what is to come. It is used to avoid disappointment, and sometimes used to arouse readers.

Example