Last week I decided to clear my diary of all social commitments and spend the entire weekend writing music. I woke up early, drank a coffee, had a great breakfast, and made my way to the studio. I was feeling well-rested and was confident that it was going to be a productive day.

Except, an hour or two into the morning, I was still looking at a blank screen. Feeling frustrated, I eventually gave up and succumbed to the multitude of distractions around me.

It turns out that this is an extremely common experience, even for professional artists. But what exactly went wrong? Why was I finding it so hard to come up with ideas on that particular day, when other times they seem to come so naturally? Let’s look to science for some clues.

Psychologists have proposed that the ability to combine existing ideas or information in new ways is more important for creativity than trying to produce ideas out of thin air. In support of this, it’s thought that our brains are constantly forming new connections between regions that process memories, knowledge, and challenges, without us even being aware of it. Every now and again, our brains bring together information in a meaningful way that results in a new idea, or a “eureka moment,” which appears to come out of nowhere. Fascinatingly, these types of lightbulb moments seem more likely to happen when we’re doing something passive like taking a shower, driving to work, or trying to fall asleep, rather than when we’re explicitly trying to be creative. And there’s a good scientific explanation for why.

A team of neuroscientists recently scanned the brains of jazz musicians by placing them in an MRI machine while they engaged in a musical improvisation task. The researchers found that during improvisation, activity significantly decreased in a brain region known as the dorsolateral prefrontal cortex. This region is typically active when we’re actively focusing on a specific task, and may work by helping us to inhibit distracting information. While this is beneficial if you’re in a job interview, it may actually harm creative thinking by masking the brain’s ability to form spontaneous ideas and connections. By reducing activity in the prefrontal cortex, the musicians were able to freely come up with musical ideas on the spot.

Read more: Burnt out? Try this.

In a related study, researchers found that individuals who scored highly on a creative task had a different pattern of brain connectivity to those who didn’t score well. Specifically, the high scorers had greater connectivity between the default mode network, a group of brain regions associated with mind-wandering, and those associated with attention. The researchers suggested that the default mode network, which is more active during passive tasks like walking and resting, may be responsible for the spontaneous generation of new ideas, while brain areas associated with attention might be responsible for sorting and making sense of such new ideas.

The most important message here is that our brains seem to be most conducive to creativity when we are exerting a lower level of mental effort, or rather when we’re neither too relaxed nor too focused. That means that if you’re experiencing a creative block, trying to force new ideas might actually make things worse. Instead, you might want to go for a jog, take a shower, play a game, or watch a lighthearted movie. Research also shows that those with a greater sense of well-being are better at creative tasks, so it helps to keep a meditation practice.

Despite common misconceptions, we all have the potential to be creative and shape our brains well into adult life. Remember that all new ideas are built on previous knowledge and experience, so continue to keep learning and you might be surprised by where your imagination takes you.