It’s not easy getting work done in outer space. Astronauts have to rotate between dozens of complex projects vying for their attention. If they mess up, an experiment years in the making could be ruined. Worse, people could die.

“The time spent in space is precious and the work you do is critical,” says astronaut Scott Parazynski, a veteran of five Space Shuttle flights and seven spacewalks. “You need to manage tasks and jump between them seamlessly without error. It’s hard.”

In order to help NASA astronauts better manage their time, we’ve been conducting research on how the transitions between tasks affects our productivity. Our findings may also have big implications for multi-taskers here on Earth.

So far, our research has measured participants’ mental engagement, emotions and the stress they experience during the transitions between fundamentally different tasks. We link these variables to how effective people are in the subsequent task.

We’ve found that residual engagement from a previous task can influence how quickly you transition to the next one. The positive or negative “buzz” that we carry from one task to the next can also affect our productivity, making us distracted or unwilling to fully engage with the next task. Our research shows that it can be especially tough to switch gears when the previous task is more complex or important or when it hasn’t been finished yet.

Much like astronauts, most of us cannot control the number of projects we have to balance. But we can figure out how to prioritize our tasks to minimize the number of transitions we have to make.

The first step is to be more conscious of the transition itself. That is, be aware of your thought process and emotional state as you move from one task to the next. This kind of mental “debriefing,” in which you think about what you’ve done and what you hope to accomplish next, can prepare you to be more effective.

You also can plan ahead by chunking together less important and less demanding tasks—say, responding to emails—to minimize the challenges of making transitions. And pay close attention to how different tasks linger in your mind, so that you can make the most of your day. If you know that you tend to be annoyed after a recurring afternoon meeting, for example, try to get your most important work done ahead of time.

Recognizing these kinds of patterns can make the difference between heading home frustrated and exhausted or arriving home with a satisfied feeling of a job well done. That should be useful for anyone—whether you are working in a windowless cubicle or hurling toward Mars.