Definition of Foreshadowing
Several times, the story mentions dreams to foreshadow its dark conclusion and suggest that sin lurks deep in the psyche of all humankind.
The story's first mention of dreams comes in its second paragraph, when Faith begs Goodman Brown not to leave her for the night, not out of concern for what he might be doing (which is, in fact, sinister), but out of concern about what she might dream while she's alone. "A lone woman is troubled with such dreams and such thoughts, that she's afeard of herself, sometimes," she says. While Faith seems to be worried that she might have a nightmare without her husband there to comfort her, Goodman Brown interprets her comment differently: "Methought, as she spoke, there was trouble in her face, as if a dream had warned her what work is to be done tonight." In other words, he thinks she might be subtly warning him against his journey because she knows, from a dream, that he's going into the woods to meet the devil. This interpretation of Faith's comment is a stretch, but it shows how guilty Goodman Brown's conscience is and—crucially—it reveals his belief that dreams can tell the truth.
In the passage below, Goodman Brown's fear of someone sinister lurking in the trees foreshadows a moment later on in the story when he himself hides in the trees, becoming the sinister presence he initially feared:
Unlock with LitCharts A+[...] the traveller knows not who may be concealed by the innumerable trunks and the thick boughs overhead; so that, with lonely footsteps, he may yet be passing through an unseen multitude.
"There may be a devilish Indian behind every tree," said Goodman Brown to himself; and he glanced fearfully behind him, as he added, "What if the devil himself should be at my very elbow!"