Rude colleagues can interfere with sleep quality. But scheduling in a fun and relaxing activity after work can help deal with the stress of a poor office environment – that's according to a new study looking at the link between work and insomnia.

The research found that verbal abuse and other negative experiences in the workplace were associated with an increase in symptoms of insomnia, such as waking up multiple times in the night.

But participants in the study who spent time doing yoga, walking, or listening to music after work, didn't experience as bad effects on their sleep patterns.

The idea is that simply taking a little time for ourselves after a crappy day might help detach us from the problems we've had during the day.

That might not sound so groundbreaking, but considering that not getting enough sleep messes with our health and literally causes our brains to eat themselves, it's important to find science-backed ways to stop annoying coworkers ruining our shut-eye.

"Incivility in the workplace takes a toll on sleep quality," says one of the researchers, psychologist Caitlin Demsky from Oakland University in Michigan. "It does so in part by making people repeatedly think about their negative work experiences."

"Those who can take mental breaks from this fare better and do not lose as much sleep as those who are less capable of letting go."

The researchers got in touch with 699 people employed by the US Forest Service, asking them to rate how much rude behaviour they were on the end of at work, as well as any symptoms of insomnia.

They were also asked about how much they were able to detach from work and relax.

These factors were weighed against other possible causes of sleep problems: the number of children under 18 living at home, hours worked per week, and alcoholic drink intake.

More incidents of rudeness from supervisors and co-workers were shown to have a negative impact on sleep, with the worst effects among those who reported that negative experiences at work frequently played on their minds.

The opposite was also true – people who were more able to detach themselves from the psychological tolls of the workplace had fewer issues with insomnia, which is where the idea of doing some kind of chilled out activity after work comes in.

The researchers note that their surveys were only carried out at one point in time, and didn't include every single factor that might negatively impact sleep. However, they're confident that this is a genuine link worthy of further study.

If we want to be at our most productive, the researchers say, employers need to address how pleasant or otherwise working atmospheres can be, as well as offer their staff opportunities to recover and refresh themselves after negative experiences.

Ultimately, the data showed that the effects on sleep quality from psychological damage by rude colleagues could be mitigated: by putting in a buffer for unwinding and recovering. It might be time to book that after-work meditation class.

With sleep known to be so important to our overall health, a better night's rest can lead to workers who are more productive and civil the next time they turn up at the office.

"Sleep quality is crucial because sleep plays a major role in how employees perform and behave at work," says Demsky.

"In our fast-paced, competitive professional world, it is more important than ever that workers are in the best condition to succeed, and getting a good night's sleep is key to that."

The research has been published in the Journal of Occupational Health Psychology.