Foreshadowing refers to dropping hints in a story about what happens later on in the book. This means that foreshadowing usually happens early on in a story such as in the first chapter.
Foreshadowing can be done in different ways. For example, a writer can drop hints in dialogue. An example is in the movie "The Dark Knight" where Harvey Dent has a line about how you either die a hero or live long enough to see yourself become the villain. This is a direct foreshadowing of what happens later on in the movie. Another example of foreshadowing occurs in mystery novels. These clues are more overt because they are in some cases actual physical clues. In contrast, foreshadowing in stories that employ mystery elements is often misleading on purpose. Characters might act in a suspicious way in order to get readers to think that the character is responsible for the misdeeds of the book. An example of this is in the "Harry Potter" series, in which Snape acts suspiciously, especially in the first novel, but has an involvement in the story that is not as clear-cut as it would initially seem. Generally, foreshadowing is a way to control reader expectations about what’s going to happen next.