A video of two young cousins in Kentucky hugging and weeping after weeks apart in quarantine was shared thousands of times.

“We did not expect for them to react the way they did,” said Amber Collins, who recorded the reunion of her 8-year-old son, Huckston, with his cousin Rosalind Arnett, 10. “They were so overjoyed they didn’t know how to express themselves, except to cry. This hug shows how powerful the human touch truly is.”

Not only do we miss hugs, we need them. Physical affection reduces stress by calming our sympathetic nervous system, which during times of worry releases damaging stress hormones.

“Humans have brain pathways that are specifically dedicated to detecting affectionate touch,” said Johannes Eichstaedt, a computational social scientist and psychology professor at Stanford University. “Affectionate touch is how our biological systems communicate to one another that we are safe, that we are loved and that we are not alone.”

What is the safest way to hug during a viral outbreak? Linsey Marr, an aerosol scientist at Virginia Tech and one of the world’s leading experts on airborne disease transmission, was asked about the risk of viral exposure during a hug. Based on mathematical models from a Hong Kong study that shows how respiratory viruses travel during close contact, Marr calculated that the risk of exposure during a brief hug can be surprisingly low — even if you hugged a person who didn’t know they were infected and happened to cough.

We don’t know the exact dose required for the coronavirus to make you sick, but estimates range from 200 to 1,000 copies of the virus. An average cough might carry from 5,000 to 10,000 viruses, but most of the splatter lands on the ground or nearby surfaces. When people are in close contact, typically only about 2% of the liquid in the cough — or about 100 to 200 viruses — would be inhaled by or splashed on a person nearby. But only 1% of those stray particles — just one or two viruses — actually will be infectious.

“We don’t know how many infectious viruses it takes to make you sick — probably more than one,” Marr said. “If you don’t talk or cough while hugging, the risk should be very low.”

Nonetheless, the safest thing is to avoid hugs. But if you need a hug, take precautions. Wear a mask. Hug outdoors. Try to avoid touching the other person’s body or clothes with your face and your mask. Don’t hug someone who is coughing or has other symptoms.

And try not to cry. Tears and runny noses increase the risk for coming into contact with more fluids that contain the virus.

While some of the precautions sound like a lot of effort for a simple hug, people need options given that the pandemic will be with us for a while, said Dr. Julia Marcus, an infectious disease epidemiologist and assistant professor at Harvard Medical School.

“There’s a real challenge right now for older people who worry that they won’t be able to touch or connect with family for the rest of their lives,” Marcus said. “Keeping hugs brief is particularly important because the risk of transmission increases with more prolonged contact.”

Here are the do’s and don’ts of hugging, based on the advice of experts:

Don’t hug face to face. “This position is higher risk because the faces are so close together,” Marr said. “When the shorter person looks up, their exhaled breath, because of its warmth and buoyancy, travels up into the taller person’s breathing zone. If the taller person is looking down, there is opportunity for the huggers’ exhaled and inhaled breaths to mingle.”

Do hug facing opposite directions. For a safe, full-body hug, turn your faces in opposite directions, which prevents you from directly breathing each other’s exhaled particles. Wear a mask.

Don’t hug with cheeks together, facing the same direction. This position, with both huggers looking in the same direction, also is higher-risk because each person’s exhaled breath is in the other person’s breathing zone.

Do let children hug you around the knees or waist. Hugging at knee or waist level carries lessened risk for direct exposure to droplets and aerosols because faces are far apart. The adult should look away so as not to breathe down on the child.

Don’t breathe during the hug. Dr. Julian Tang, a virologist and associate professor at the University of Leicester in England, advocates for holding your breath during hugs. “Most hugs last less than 10 seconds, so people should be able to manage this,” Tang said. “Then back away to at least 2-meter [about 6 feet] separation before talking again to allow them to catch their breath at a safe distance.”

Do kiss your grandchild on the back of the head. In this scenario, the grandparent is minimally exposed to the child’s exhaled breath. The child could be exposed to the taller person’s breath, so kiss through a mask.

Don’t talk. Yuguo Li, a University of Hong Kong engineering professor and senior author on the paper that Marr cited to make the calculations, said that hugs probably pose less risk than a longer face-to-face conversation. “The exposure time is short, unlike conversation, which can be as long as we like,” he said.

Do choose hugs wisely. “I would hug close friends, but I would skip more casual hugs,” Marr said. “I would take the Marie Kondo approach: The hug has to spark joy.”