The most obvious form of foreshadowing, in giving direct information, sometimes a writer will not only hint at what is to come, they will make it clear. If the audience, or reader, is shown that a band of highwaymen lay in wait for the protagonist, then this foreshadows that the protagonist will be jumped. This serves to heighten the tension and invoke the reader's concern. The outcome of what happens is still unclear. The protagonist might have no problem dealing with the threat or might avoid it all-together. Or the foreshadowing could prepare the reader for a major negative turn in the protagonist's journey.
Writers can make use of the weather, location and any other element of the atmosphere to set the tone and foreshadow events. Storms are often signs of ill omen, while their departure can indicate that the danger has finally passed. This is sometimes some of the most subtle examples of foreshadowing, as the color of a room may hint at what will soon transpire in it. In film and other narrative mediums with music, the score is often used to foreshadow. This is most noticeable in horror films, where the score builds tension as a potential victim is stalked. Music can be used in any genre to guide expectations one way or another.
Oftentimes foreshadowing is less subtle, where the author will "plant" a detail in the story that may seem unimportant or of ambiguous importance, only for it to "pay-off" later in the story when the significance of the detail comes to light. This not only sets later events up to be more believable, it also draws the reader or audience further into the story by giving clues and hints but not the whole picture.
Foreshadowing can be subverted and used to mislead the audience. This is called a red herring in detective stories, though the device is used across genres to set up expectations and satisfy audiences with something they didn't expect.