Scrolling through photos on Instagram or reading updates on Facebook can be draining. It can seem as if everyone else is having more fun or achieving greater success or getting more likes for their photos and status updates.

Yet social media is also how many people stay connected with friends and relatives who live in different cities.

So how can people reap the benefits of social media without letting it harm their mental health?

Researchers have come up with a few easy-to-follow tips. But first, what are the dangers that social media users may face?

Several studies have linked social media use with depression, envy, lower self-esteem and social anxiety. A recent study reported that one in three young adults who see images of cutting on Instagram will engage in cutting in a similar manner.

Yet, this body of research often faces the criticism that people who already have mental health challenges are likely to spend more time on social media, rather than social media being the cause of their illness. One study that followed British teenagers over eight years found that social media has limited effects on the typical adolescent's well-being. It was mostly harmful for vulnerable groups, such as teens predisposed to depression and anxiety.

Because most studies focus on specific populations — teens or young girls, for instance — it's hard to know for sure how social media affects mental health for the overall population.

So, what can we do to protect ourselves?

Jelena Kecmanovic, an adjunct professor of psychology at Georgetown University, recently wrote an article for the Conversation about how to avoid the dangers of social media. She offered a number of tips.

• Limit when and where you use social media. Using social media can interrupt and interfere with in-person communications. Consider turning your social media notifications off or even putting your phone in airplane mode during meals with family and friends, conversations with your partner and meetings at work.

• Don't use social media right before going to bed. Multiple studies show that using devices at this time disrupts your sleep.

• Consider scheduling regular multiday breaks from social media. Several studies have shown that a five-day or weeklong break from Facebook can lead to lower stress and higher life satisfaction. If that seems too extreme, just limiting your social media use to 30 minutes a day can reduce feelings of loneliness and depression.

• Pay attention to how you feel. Instead of mindlessly scrolling through Facebook or watching Snapchat stories, try to be mindful every time you use social media. Do you check Twitter first thing in the morning because you need to be informed about breaking news or because it's an ingrained habit? Does viewing photos of your friend's vacation make you happy or envious?

Each time you check social media, think about why you're doing it, how it makes you feel, and whether that's really what you want.

• Narrow your online networks and pay more attention to your real-life relationships. Over time, most people accumulate online friends and organizations they follow that are no longer relevant. Some of the content is boring, annoying or even upsetting. So unfollow, mute or hide them.

One study found that people whose social media included inspirational stories experienced gratitude, vitality and awe, so consider adding a few motivational or funny sites to your feed.

It's also important to remember that online connections cannot replace real-life interactions. Humans have an innate need for connection and belonging. Spending time with friends in person and building networks offline can be protective for your mental health.

The upside

All that taken into consideration, there are good things that come from social media. Researchers are finding ways to harness the power of social media to benefit mental health, too.

Studies have shown that analyzing language from Facebook posts can help predict whether a user is depressed up to three months before the person receives a medical diagnosis. Another study found that the color, lighting and symmetry of photos shared on Twitter may give insight into who is at risk for anxiety and depression.

Smartphones also can be portals to helpful tools, like meditation apps — some of which have been shown to make people feel less lonely and increase the number of in-person social interactions they have each day.

While online communities may not replace face-to-face connections, they do provide an important space for many people dealing with rarer and often stigmatized mental illnesses, such as bipolar or borderline personality disorder. Many individuals turn to Facebook groups or online gaming platforms to connect with others who share similar experiences. People of color have also used social media to develop private communities where they can discuss the impact of racism on mental health.