"Young Goodman Brown" is a key example of Hawthorne's examination of the conflicts between good and evil that -- he believes -- are always at work in the human psyche. There are several ways that you could state the theme/thesis of this story --
a) Wickedness exists in every human;
b) Even the people who appear to be models of goodness and propriety have secrets to hide;
c) Nobody is exactly as they appear.
The name of the main character, "Young GOODMAN Brown," is a tip-off to the fact that this story is going to be about morality. "Goodman" is not so much the character's name as it is a common form of address in colonial times. Nevertheless, it raises the question whether the young man is truly as "good" as he may seem.
More in question is his wife, who is first introduced as "Faith, as the wife was aptly named." Right from the start, Hawthorne sets up his two protagonists as model citizens, in what was a very religious community.
On that night, Goodman Brown leaves his wife to go walking in the woods, meets a mysterious stranger (suggested to be the Devil), and ultimately sees a group of otherwise upstanding women from the town engaged in wild dancing that appears to be driven by witchcraft and devil worship. Goodman Brown is horrified to see his wife Faith as part of the group.
In the concluding paragraphs, we see that this incident, which may or may not have just been a dream, has the effect of shaking all of Goodman Brown's beliefs about the people around him. Just as his beliefs are shaken, Hawthorne intends to raise questions for the reader as well. Can we trust the trustworthy? Can we believe what we think we believe? Are good people as good as they seem, or do they have hidden evils? Which is the reality, and which is the dream?
For an excellent overview, see the enotes.com reference on Young Goodman Brown at the source noted below.