Anyone who has lived with a depressed or anxious partner knows that such emotions are contagious. And this is now backed by hard science. According to a recent study, conducted by the Institute for Cognitive and Brain Sciences, even the sight of a friend in distress is enough to produce a physiological reaction. Repeated exposure to such pain triggers the release of cortisol which, in high doses, upsets the hormone balance, impairs sleep quality, and leads to weight gain.

But why does this happen? In a sense, you are a victim of your own empathy. You have evolved to empathize, or tune into, other people’s emotional states, and once you have tuned in, to then mimic or imitate those emotional states. Surprisingly, human beings are not alone in this. The old joke about dogs coming to resemble their masters may be truer than people realize. Evidence suggests that a dog owned by someone in the grips of depression will itself be affected.

Take a moment to consider the people closest to you. List everyone you see more than once a week and put a cross by those you’d consider anxious or depressed. How many of them talk relentlessly about frightening, depressing subjects? How many of them seem forever agitated and worried? Most importantly, consider how you feel after spending time with them. Do you leave their apartment feeling worse? Did you notice your anxiety levels drop and your mood lift when they went away for a few weeks?

Once you have identified the individuals who affect you, you must decide what to do. Of course, it is not always possible to simply cut them from your life. For a start, there is the moral question. Those who cause us second hand stress often do so because they are themselves frightened and damaged. But you must consider yourself. If you are vulnerable to second hand stress, that is probably because you already suffer anxiety and depression. You alone know the situation.

If you cannot completely remove such people from your life, you could at least try the following:

1) Spend less time with them and more time with happy, cheerful, positive people. Just as stress and depression are catching, so too are joy and happiness. You may not be able to rid yourself of such people, but you can at least reduce the amount of time you spend with them. You may have to be explicit and tell them that you love or care for them but that you find their company makes your own anxiety worse. Explain that it isn’t their fault, that anxious people make one another anxious; it cannot be helped. Be gentle and reassure them that you will continue to be there for them, but that you must consider your own needs as well.

2) Acknowledge what is happening. Once you are aware of what is happening, you will be better prepared. For example, imagine you have an old friend whose marriage failed, who slipped into depression, lost his job, and had a nervous breakdown. You often visit him in his apartment and always come away feeling anxious and depressed. People find themselves in these sorts of relationships without ever recognizing the effect it is having on them. So next time you go to visit such a person, prepare yourself. Make a conscious decision to disregard all the miserable, negative things they say.

3) Be more choosy in future. If you know that you get stressed easily and that the moods and opinions of other people affect you, be careful with whom you become involved. Seek out mellow, relaxed, cheerful people, those with an upbeat, life-affirming attitude. And of course, if you meet someone who makes you feel stressed and negative, distance yourself from them!

Never underestimate the danger of second hand stress. And more importantly, never underestimate how vulnerable you are to it. People often imagine themselves to be somehow immune. But you are no more immune from someone’s low mood than you are from their nasty cold.