Trick-or-treating is an old tradition. (The History Channel has a good explanation of its origins.) Past generations of children took candy from strangers on Halloween. You have probably already tried to teach your child not to accept candy from strangers. Halloween is a good opportunity to see how well your child understands.
If you ask four year olds what a stranger is, many will not be able to answer. Those who do will mostly fall into two categories: a person you don’t know and a bad person. When I ask kids I have never met before if I am a stranger, many say no. Some justify it because they know my name. Others justify it because I have been talking with them a few minutes. Some assume that if I know their parents then I am not a stranger.
Candy and rides are often mentioned when teaching children about stranger safety. There are lots of other enticements that are used to lure children. If your child is old enough to understand, give a quiz asking if it is ok to take specific things (money, candy, stickers, toys) from people they have never met, people their parents know, etc. Just talking about it before Halloween can give you a great opportunity to reinforce the lesson when you Trick-or-Treat. If you are going house to house, explain how you do or don’t know specific neighbors and qualify them a strangers or not. If you are going to a trick-or-trunk event in a parking lot, explain how you know that the adults giving out treats are safe. If you go from store to store in a mall or booth to booth at a fair, you can ask about who strangers are and what behavior is safe.