This year, I spent a few months working at the friendliest company I’ve ever encountered.

There was an office happy hour every Friday afternoon. One day, some hero set up a hot chocolate bar, complete with crushed candy canes and marshmallows. Employees were encouraged to send one another thank-you notes around Thanksgiving. I sent out zero, because I didn’t think people would actually participate, but then I received four.

It was a far cry from the deserted, low-morale workplaces of my past gigs. And my eventual return to full-time freelancing — I was only there to cover someone’s maternity leave — was bleak in comparison. Now, some days, the extent of my social interaction consists of two sentences: “Large single-origin drip, please,” and “Would you mind watching my stuff for a sec while I find the bathroom?” Sure, I text friends and talk on the phone, but they don’t provide the same daily social interaction as actual co-workers. And though I, an introvert, generally prefer no people over people, I still get lonely by Wednesday of each week.

I’m not alone in this. If anything, social isolation during the workday is so rampant that Vivek Murthy, the former U.S. Surgeon General, likened it to an epidemic. “This is certainly a trend that’s growing,” says Darcy Gruttadaro, the director of the American Psychiatric Association Foundation’s Center for Workplace Mental Health. “It presents a challenge for employers to help people feel engaged and social in the workplace.”

Social isolation at work can have major consequences for almost every aspect of your life. “Studies have shown that the risk [of social isolation] to your health and well-being is equal to 15 cigarettes a day,”Gruttadaro says. A recent study even linked loneliness, including perceived social isolation (meaning you feel isolated, whether or not you actually are), to a higher risk of both cardiovascular disease and overall mortality.

Then, there are the career consequences. “Lonely people want to know why they feel lonely,” says Hakan Ozcelik, a management professor at California State University, Sacramento. So, they often make a leap in logic: If they don’t feel close to anyone in the office, they begin to question whether they belong in the department or organization entirely — sometimes to the point that they feel like the organization is turning against them. As a result, “they start minimizing their engagement, because their work feels very functional and transactional — like the bare minimum,” explains Ozcelik, who co-authored a study on workplace isolation in the Academy of Management Journal. The resulting poor performance can lead to repercussions from management, which in turn may foster even worse performance and eventual departure.

“It’s not about interaction. It’s about the quality of the relationships.”

It’s no picnic for companies, either. Hiring and training a new employee, versus just retaining an existing one, is both expensive and time-consuming. Knowing this, businesses may be more likely to invest in steps to minimize workplace loneliness — but loneliness is complicated. Different offices function differently, and especially when not everyone is in the same physical location, fostering connectedness isn’t as easy as gathering employees into a conference room, putting a Jenga set on the table, and hoping that friendships blossom.

“It’s not about interaction,” Oczelik says. “It’s about the quality of the relationships.”

And over the coming decades, changes in the way we work will only make those quality relationships more elusive. Remote work and self-employment are on the rise, cutting more people off from regular interaction with co-workers. Work culture is evolving to put a greater emphasis on productivity, Gruttadaro says: “It used to be that people socialized at the watercooler and felt comfortable doing so,” she explains. By contrast, “there’s now a perception that people need to put their nose to the grindstone and be productive.” But even as these challenges become harder to conquer, there are steps that companies and workers can take to keep the workplace loneliness epidemic from spiraling out of control.

Lead by Example

To start, managers should always have a sense of the risk loneliness poses for their employees. “Evaluate the social connectedness of the workplace by asking employees whether they’re teleworking or coming to the office every day,” says Gruttadaro, “and figure out from there how aggressively you need to work to change things up.”

“I think the biggest thing human resources can do is ensure they have a solid culture that’s instituted from the top,” says Tracie Sponenberg, a senior vice president of human resources for The Granite Group.

Gruttadaro agrees: “The more leadership can model [a collaborative space], whether it’s by holding an off-site where they share their experience or talking about the importance of social connectivity, the more employees will recognize the importance in it and follow suit.” If your organization is slow on the uptake, she recommends gathering a small group to take up the issue with human resources.

Train Managers Properly

Managers can also take a more direct, active role in fighting loneliness. “First-line managers are critical, and having someone who’s not trained — or just a bad manager — can impact a lot,” Sponenberg says. Someone who leads a team is in an ideal position to organize and structure groups within their department.

“The manager needs to act like a social architect,” Ozcelik says. One way to do this is to create dependency — that is, leave employees with some slack to make mistakes and seek advice and guidance from colleagues. In this environment, “employees can ask for help from one another, a condition in which we’re programmed to be close,” he says.

Sarah Wright, a senior lecturer at University of Canterbury in New Zealand, who studies social relationships at work, is also a fan of micro-relational behaviors, such as suggesting that employees make a coffee date or making introductions between newbies. “By reducing the gap between their desired and actual relationships, they’ll start to feel less lonely,” Wright says.

Be Better at Onboarding

For new hires, HR can help in a number of ways, including by making strategic pairings. “If you have someone coming into the organization” who might be on the shyer side, Sponenberg says, “you can make sure [they] are connected to others immediately.” Where possible, enlist more gregarious employees to help train the new ones and show them the ropes.

For people joining in management roles, or newly promoted into them, HR can also offer insight into the workplace social strata and help manage expectations. “To counter loneliness, you have to lower your expectations of the types of relationships you can have in that environment,” Wright explains. “So, if you’re new to a management role, don’t expect to be chummy with your subordinates, and look for social fulfillment elsewhere.”

Use Technology Wisely

Whether screens are on desks or in employees’ hands, they can have a detrimental effect on sociability, keeping people isolated even if they’re in the office. For example, “even on their commute, people have their earbuds in — and the same is true in the workplace,” Gruttadaro explains, preventing camaraderie-building chitchat from taking place.

People bringing their laptops into meetings is another issue, points out Dan Schawbel, research director at Future Workplace and author of Back to Human. “People complain about meetings because no one is paying attention,” he says. “You’re looking down, not up.” Not only is it impossible to effectively multitask mid-meeting, but trying also makes you less likely to contribute and interact overall.

Schwabel recommends that companies create a thoughtful culture around technology, highlighting when it’s useful and when it’s not. If that’s reinforced up the ranks — the boss entering a meeting with just a notepad and pencil, or making a point to put the phone away during in-office happy hours — that’s even better.

Reconsider the Layout of the Workspace

Paradoxically, the more open the floor plan, the more the office layout can inhibit interaction. “Visually, it can bring in a lot more light to the particular space,” Sponenberg says, but on the other hand, “you can’t focus if you’re sitting two feet from someone who’s on the phone.” And the side effect of a lack of personal space is that people tend wear noise-cancelling headphones, stake out private conferences or phone booths, or find similarly isolating ways to get a little privacy. “With cubicle walls, you have privacy if you’re sitting, but can always stand up and talk to someone,” she adds.

Give Remote Employees Plenty of Opportunity for Face Time

One case where technology is more of a solution than a problem: video conferencing. It can be awkward, but it’s better than phone calls. “If teleworking is a major part of your business, or you’re a virtual organization, you have to get much more creative about socially connecting people,” Gruttadaro says. Being able to actually see a colleague, be it a yearly off-site or monthly happy hour or virtual meeting, is helpful.

“Technology can be a tool to help remote workers feel more physically present,” Sponenberg says. “Do what you can through Skype and virtual meetings, where you can see body language and facial expressions. Then, bring them in periodically so they can see each other face-to-face.”

Companies should also facilitate meetings between remote employees in the same area or provide resources for them to join local professional groups. “You need to stay socially connected to people in your industry — and especially your peers,” Gruttadaro says. “When you see an opportunity to meet for coffee or after work, it’s important to take advantage of that.”