In a culture that worships productivity and goal-directed behavior, daydreaming often gets a bad rap: Space cadet. Zoned out. Head in the clouds. That doesn’t stop our minds from wandering, though: Astonishingly, we spend nearly half of our waking hours lost in thought, our minds drifting to topics unrelated to whatever it is we’re doing.

The good news? Recent research suggests that daydreaming isn’t always counterproductive. In fact, when done the right way, daydreaming encourages out-of-the-box thinking and can even boost your brainpower.

A study from Georgia Tech suggests that daydreaming is correlated with intelligence and creativity: Those who reported more frequent daydreaming scored higher on intellectual and creative ability and had more efficient brain systems, as measured by an MRI machine.

Another benefit: A daydreaming mind can make associations between bits of information in a way that you’d never considered before. “Often the ‘dialog’ that occurs when the daydreaming mind cycles through different parts of the brain accesses information that was previously out of reach,” explains Eugenio M. Rothe, a professor and psychiatrist at Florida International University. These connections can spark creativity, wise insights, and unexpected solutions to problems.

Most experts say daydreams themselves aren’t inherently good or bad. So what determines whether our daydreams are performance enhancers or simply distractions? The key is to curate the content of your daydreams so your mind can wander in the right direction. Here are three questions to ask yourself that will help you do just that:

  1. Are my daydreams realistic or based on fantasy?

The problem: Fantasy-based daydreams can lead to disappointment when you “come back to earth.” For example, a study published in the Journal of Personality and Social Psychology found that daydreaming about a romantic partner you don’t (or can’t) have can actually negatively impact your relationship with that person, and students who fantasize about academic achievement generally receive lower course grades. Why? Because they focused all of their attention on the desired outcome, the study participants failed to consider how to make their dreams come true.

The solution: Realistic daydreams, on the other hand, let us picture what might actually be possible for our lives. A study in the Journal of Happiness Studies showed that daydreaming about the steps you need to take to accomplish a specific goal can help you make progress toward that goal, because you can rehearse for the future and mentally test out different scenarios without real-life risk.

  1. Do my daydreams focus on negative events?

The problem: If, in your daydreams, you ruminate on a chain of progressively dire and unlikely consequences culminating in the worst possible outcome, you’re likely falling into a Worst-Case Thinking Trap. With this type of thinking, you spend too much time worrying endlessly about things that aren’t likely to happen and not enough on what is most likely to happen.

The solution: Assessing the probability of the worst-case scenario on a scale of one to ten interrupts this cycle, giving you a clearer perspective and keeping you grounded in reality. For example, if you’re feeling anxious about an upcoming presentation, ask yourself: How likely is it, really, that you’ll be so terrible during your presentation that you lose your job? (Answer: Not very likely!) Then, shift into a more positive mindset by imagining the best possible outcome for the scenario you imagined. While the most realistic outcome is somewhere in the middle, thinking about what could possibly go right will help you break out of the negative thought chain.

  1. Can I snap back to the task at hand?

The problem: Researchers from the Georgia Tech study say one clue that you’re a “high-functioning” daydreamer is that you can zone out of conversations or tasks—and then naturally tune back in without missing a beat. Think of the absent-minded professor who’s brilliant but often off in their own world, or kids who are intellectually ahead of their classmates. “While it may take five minutes for their friends to learn something new, they figure it out in a minute, then check out and start daydreaming,” explains Eric Schumacher, a co-author of the study.

The solution: The more out of context our musings are—for instance, picturing yourself blissed out on a powdery-sand beach, sun shining, cold drink in hand, when you’re actually in the office trying to do your work—the harder it can be to reorient yourself to what you were doing before your thoughts began to drift. When you’re at work, try directed daydreaming, where you focus on a particular challenge or problem you’d like to solve. Keeping your mind from wandering too far will make it easier to transition back into the present moment.

Over the last 10 years, Janet Ungless has developed a comprehensive expertise in health and wellbeing as a writer and editor. With a particular focus on sleep, meditation, and wellness, Janet has worked with a host of digital platforms to help consumers live healthier, happier lives. Find her on Twitter @jungless.