When her daughter was preschool-aged, Rebecca Spencer experienced something familiar to many parents and childminders: the power of a nap. Without it, her daughter would be giddy, grumpy, or both.

Spencer, a neuroscientist focusing on sleep at the University of Massachusetts Amherst, wanted to investigate the science behind this anecdotal experience. “The observation of a lot of people is that a napless kid is emotionally dysregulated,” she says. “So that spurred us to ask this question of, ‘Do naps actually do something to process emotions?’”

Research has already shown that, in general, sleep helps us make sense of emotions. Sleep plays a key role in encoding information based on experiences from the day, making sleep critical for preserving memories. And emotional memories are unique because of the way they activate the amygdala, the brain’s emotional core.

“Amygdala activation is what allows your wedding day and the funeral of your parents to be a day better remembered, more than just any other day of work,” Spencer says.

You might also like:
Why sleep should be every student’s priority
Can staying awake beat depression?
Why are we all so tired?

The amygdala tags these memories as significant, so that during sleep they’re processed for longer and reiterated more than more trivial memories. The upshot is that the memories of emotional significance become easier to retrieve in the future.

But by influencing how memories are processed, sleep can also change the power of a memory itself.

“Sleep is particularly good at transforming emotional memory,” says Elaina Bolinger, who specialises in emotion and sleep at the University of Tuebingen.

In one recent study with eight-to-11-year-olds, Bolinger and colleagues showed children both negative and neutral pictures. The children reported their emotional response using stick figures corresponding to how they felt.

Then some of the children slept. Others did not. The researchers monitored their brain physiology via electrodes from the next room. The next morning, the kids saw the same pictures, plus some new ones. And compared to the children who stayed awake, children who slept were better able to control their emotional responses.

For instance, the sleepers had a smaller emotional response in late positive potential (LPP). Bolinger describes the LPP as voltage measured at the back of the brain. This fires up whenever the brain is processing information – and the spikes are especially large when that information is negative emotion. But humans can control the LPP to some extent. As Bolinger puts it, “We are actively trying to change how we feel about something while we’re perceiving it. So we’re saying, ‘OK, I am trying to not respond very strongly right now, I want to push down my emotional response.’”

This research suggests that sleep helps with both crystallising emotional information – and with controlling how it makes us feel. And this effect works quickly.

A lot of the research is pointing in the direction that a single night of sleep is helpful for processing the memory itself, and for emotional regulation in general – Elaina Bolinger

“A lot of the research that’s out there right now is pointing in the direction that a single night of sleep is helpful,” says Bolinger. “It’s helpful for processing the memory itself, and it’s also important for emotional regulation in general.”

But not all sleep is created equal.

Types of sleep

Rapid eye movement (REM) sleep is associated with emotional memories, and more REM sleep makes people better at assessing others’ emotional intentions and recalling emotional stories. One theory relates to the absence of the stress hormone noradrenaline during REM sleep. Temporarily relieved of this hormone, the brain may use the time to process memories without the stress.

Simon Durrant, who heads the Sleep and Cognition Laboratory at the University of Lincoln, explains another aspect. The prefrontal cortex is the most developed part of the brain – the location, Durrant says, of the “human impulse to keep calm and not just react immediately to things”. During wake, this is the part that keeps the amygdala, and thus emotions, in check. During sleep, that connection is reduced. “So, in a sense, it’s taking the brakes off the emotion during REM sleep,” he says.

Scientists have debunked the idea that dreams, which are most emotionally intense during REM sleep, can be meaningfully interpreted. But recent experiences often do turn up in dreams, mainly in the form of emotional content rather than a replay of events. Durrant says that there’s tentative evidence “that what occurs more in dreams is also what is remembered more”.

The process has been investigated by pioneering sleep researcher Rosalind Cartwright. Cartwright’s theory is that during dreams, distressing real-life experiences are integrated with similar memories. Thus, dreamers are better able to contextualise painful new memories against more settled ones, removing the sting.

But Spencer believes that non-REM sleep also plays a role. Slow-wave sleep (SWS) is the first phase of sleep that consolidates memories, and is especially good for processing neutral memories. Spencer’s research suggests that the amount of SWS activity during sleep affects how emotional memories are transformed.

Kids are really emotional without naps, and they’re hypersensitive to emotional stimuli – Rebecca Spencer

Naps mostly consist of non-REM sleep – including SWS in longer naps. And a recent paper co-authored by Spencer appears to be the first to show that naps, and not just overnight sleep, contribute to emotional memory processing in children. Without a nap, children showed a bias toward emotional faces. With a nap, they exhibited what Spencer calls the "cool as a cucumber" effect, where they responded similarly to neutral stimuli as to emotional stimuli. In essence, “kids are really emotional without naps, and they’re hypersensitive to emotional stimuli”, she says – because they haven’t consolidated the emotional baggage from earlier that day.

Spencer believes that naps are also helpful for emotional processing in adults, though not to the same extent. An adult has a more mature hippocampus, and thus a stronger ability to hold onto memories. Wake isn’t as damaging.

That’s only up to a point, though. Spencer’s ageing-related research suggests that “you need to more frequently consolidate memories as you get older, because you could have a similar degeneration of hippocampus storage with ageing”.

Interestingly, older adults show a bias towards positive memories while young adults skew negative. That may be because it’s adaptive for children and teenagers to focus on negative experiences, because that contains key information that needs to be learned: from the dangers of fire to the risks of accepting a drink from a stranger. But towards the end of life, people prioritise the positives. They also get less REM sleep – the kind of sleep most likely to entrench negative memories, especially in people with depression.

Therapeutic uses

For individuals without disordered sleep, Bolinger says that the cortical integration function of sleep “gets stronger with time. So that first night of sleep puts you at an advantage for emotional processing down the road."

One study suggests that sleeping within 24 hours of a traumatic experience will make those memories less distressing

Sleep researchers are also looking at the potential of certain facets of sleep, such as lucid dreaming, to treat post traumatic stress disorder (PTSD). One study suggests that sleeping within 24 hours of a traumatic experience will make those memories less distressing in the subsequent days. For people with anxiety, sleep therapy might help with reminding people that they’ve eliminated their fear.

But while people with typical cognitive patterns need sleep to recover from intense experiences, it may be different for those with depression.

Wake therapy, where people are deliberately deprived of sleep, is spreading as a method of treating depression. It doesn’t work in all cases. But it may be that it jolts the circadian system, which is prone to sluggishness in people with depression.

Sleeplessness in some cases may have a protective effect. Spencer points out that following intense trauma, “the natural biological response in those conditions is that we have insomnia”. This may be an appropriate response to an unusual situation.

So sometimes it can actually be a good thing that REM sleep deprivation harms the brain’s ability to consolidate emotional memories. “There’s good evidence that people who have longer REM sleep tend to be more depressed,” Durrant says. He believes that this is because a subset of people with depression are re-consolidating negative memories during REM sleep.

Why does sleeplessness help the emotional state of some people with depression and trauma, but not others? New work by Durrant and colleagues suggests that the difference may come down to genetics. A particular gene, called the brain-derived neurotrophic factor (BDNF) gene, appears key to memory consolidation during sleep.

People with a specific gene mutation are vulnerable to the frequent, unhelpful circling of negative memories during sleep – for them, it could be helpful to go to sleep early and get up very early

And the new research suggests that people who have a specific mutation of the BDNF gene are vulnerable to the frequent, unhelpful circling of negative memories during sleep. For them, it could be helpful to go to sleep early and get up very early to minimise the amount of REM sleep. For the same reason, Durrant would also recommend an afternoon nap.

“I don't think we’re going to solve this even in my lifetime,” says Spencer of all the potential clinical applications of sleep and wake therapy. But what’s clear is that certain kinds of decision-making improve following sleep, partly because of the way sleep regulates all those swirling feelings.

Bolinger puts it plainly: for the most part, “sleep helps you feel better”.

Ultimately, the best prescription for a broken heart or a clouded mind may be having a kip.

Join 900,000+ Future fans by liking us on Facebook, or follow us on Twitter or Instagram.

 If you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Culture, Capital, and Travel, delivered to your inbox every Friday.