Consciously teach critical thinking. The younger your child the more s/he needs your help sorting out what is real and what is not.
Do not worry about a pre-preschooler’s fantasies; at the same time, point out the make-believe stuff. Label play and make-believe as pretending or imaging.
Saying “It is fun to believe in dream of being a major league star, but not all dreams come true will not seriously diminish the child’s pleasure, while paving the way for when s/he begins to understand what is real and what is not.
Once the child stops believing in the Santa Claus or similar myths, start asking as you watch movies or media together “What’s real about that?” or “What’s fantasy about that?”
As the teens are entered upon, continue the discussions suggested above, but go deeper. One easy way to encourage deeper thought is to say “And” when the teen seems to have reached a limit in his thoughts.