Instructions
View your map using the "-" button to find the location of Nook's store
Go to Nook's store on October 31 on the game's calendar.
Buy the candy (either blue, red, yellow or green) for 400 bells each by pressing the "A" button to confirm your selection.
Speak to villagers wearing pumpkin masks on Halloween and give them candy. Talk to Jack at the Halloween party (he will be the only villager who doesn't approach you) and he will give you spooky items for your candy. Refuse to give him candy and you can earn four other special items by speaking to him on four separate occasions on Halloween.