Feeling anxious? Try doing something nice for someone else.

Science says it helps.

Bringing a cake to share at the party
Flashpop/DigitalVision/Getty Images
Like Harry Styles said

In today’s highly individualistic culture, selfless acts can be a little hard to come by. But it turns out, Harry Styles was right: Treating people with kindness really can help you “find a place to feel good.” According to a study recently published in The Journal of Positive Psychology, performing acts of kindness can help people suffering from symptoms of anxiety or depression find relief and healing.

The study compared engaging acts of kindness with other therapeutic techniques to determine how they fared in improving social connection for people with anxiety or depressive disorders. “Social connection is one of the ingredients of life most strongly associated with well-being,” David Cregg, study co-author and doctoral candidate in clinical psychology at The Ohio State University, said in a Jan. 10 news release. “Performing acts of kindness seems to be one of the best ways to promote those connections.”

To test their theories, researchers randomly split the study participants — all of whom had “elevated anxiety or depression symptoms” — into three groups and assigned each group a technique to engage in for at least two days a week. Two of the techniques, planning social activities and cognitive reappraisal (identifying and then revising negative thought patterns), are regularly used in cognitive behavioral therapy (CBT). The third group was asked to engage in acts of kindness toward other people — things like baking cookies for friends, offering to give a friend a ride, and leaving sticky notes for roommates with words of encouragement.

The results were incredible: Not only were these random acts of kindness effective in relieving symptoms of anxiety and depression, but they were also more effective at improving general life satisfaction than typical (CBT) techniques. According to the study’s results, the acts of kindness helped participants in multiple ways: by helping people feel more socially connected to those around them, and by allowing people to take their minds off their own symptoms of anxiety and depression.

SDI Productions/E+/Getty Images

“We often think that people with depression have enough to deal with, so we don’t want to burden them by asking them to help others. But these results run counter to that,” said study co-author and professor of psychology at Ohio State Jennifer Cheavens. “Doing nice things for people and focusing on the needs of others may actually help people with depression and anxiety feel better about themselves.”

That’s not all a little kindness can do: As experts previously explained to Mic, just witnessing an act of kindness can have positive effects on your mental health. You know that warm, fuzzy feeling you get when you see someone doing a good deed — like helping a lost puppy or giving a stranger flowers? That’s called “moral elevation,” according to UC Berkeley’s Greater Good Science Center. It’s a result of increased activity in the body’s parasympathetic nervous system (PNS), which plays a huge role in soothing and calming someone down.

So the next time you’re feeling down, try not to get caught up in your own head. It’s definitely easier said than done, but if you’re able to focus on encouraging and uplifting the people around you through a few simple acts of kindness, you very well may feel better as a result. “We found that a relatively simple, one-time training had real effects on reducing depression and anxiety symptoms.” Cheavens said. “There’s something specific about performing acts of kindness that makes people feel connected to others.”