Young Goodman Brown sets out into the woods of an evening for "an evil purpose." After he says goodbye to his pious young wife, Faith, he comments to himself:
"Poor little Faith!" thought he, for his heart smote him. "What a wretch am I, to leave her on such an errand! She talks of dreams, too. Methought, as she spoke, there was trouble in her face, as if a dream had warned her what work is to be done to-night. But, no, no! 'twould kill her to think it. Well; she's a blessed angel on earth; and after this one night, I'll cling to her skirts and follow her to Heaven."
From a literary perspective, we have no idea why he's going on this errand, knowing that he plans to do something evil. This is a question that isn't answered. What sort of man is he?
He lives in Salem (home of the infamous witch trials, and Puritan through and through), and his entire village is deeply pious (or so he believes), yet he chooses to set forth on an errand into the woods at dusk to become a new convert of the dark lord. Why does he go, if he is horrified of the idea and frightened that Faith might find out?
To the Puritans, Satan was a real person, a concrete being. He was thought of as the Dark Man (in The Scarlet Letter), and he appears in this story in a similar way. Goodman Brown believes in God, the Devil, and the existence and power of witches with dark powers (as do his family and neighbors). The atmosphere of the story--the spookiness of the darkening forest with its frightening sounds, the apparent appearance and disappearance of people, and the eventual great meeting of the saints and sinners to welcome their new converts--emphasizes the superstition of our protagonist. In a sense, we (the readers) become Puritan by proxy when we read this story. We want to take his arm and guide him back to the village, to stop him, save him.
Everything outside the bounds of the village is dreamlike--or supernatural. We cannot know which, and neither does Goodman Brown. Thus, we never find out. The problem is, it ruins him forever. He can never see his wife and neighbors the same way again.
An alternate possibility is that he does dream it, but the dream is a vision, providing insight into the reality of people's hearts--the minister, his wife, the pious and the wicked.