Not everyone is ready to embrace this greeting.

Narendra Modi, the prime minister of India, is known for being what the New York Post described as a “serial hugger.” From Francois Hollande to Vladimir Putin to Barack Obama, Modi has hugged them all.

But when he went in to hug President Donald Trump at a news conference Monday, it didn’t go well. Trump reportedly extended a hand for a handshake, and then appeared “stiff and uncomfortable” when Modi opened his arms for a hug. Modi believes that hugging is necessary for building professional relationships and trust, experts told the Post.

Sometimes it’s hard for us all to know when to hug or when to shake hands. So Moneyish asked the experts for their advice.

When in doubt, shake it out. While a failed handshake can usually be chalked up to a misunderstanding, a failed hug can lead to a very awkward situation, as Marco Rubio learned the hard way last week, when he tried to hug an unresponsive Ivanka Trump at a policy meeting — and wound up sending Twitter abuzz.

If Rubio had gone in for the handshake instead, he might have basked in these benefits. A recent study in the Journal of Cognitive Neuroscience demonstrated that a handshake before an interaction is likely to make that interaction more positive, and its participants more likely to develop favorable views of each other. And a study by the University of Alabama found that people with firm handshakes are more likely to be outgoing, and less likely to be shy.

Bottom line: “The people who enjoy hugging are also comfortable with a handshake, but there are some people who really don’t feel comfortable with a hug,” says Katie Bennett, career coach and co-founder of Ama la Vida Coaching. So if you’re not sure which greeting your friend or colleague prefers, you can’t go wrong with a handshake.

Watch other people’s behavior for clues. “Observe how the person greets others for a good guess as to what they accept,” said Tina Mertel, executive career coach at Meaningful Coaching. Body language can help you out too. “Some people have a more closed body language, maybe they’re looking down, looking more timid or shy,” Bennett said. “Those people won’t feel as comfortable with a hug. If someone seems to have open body language and a high energy level, that’s someone who’s going to be a lot more open to it.”

Don’t hug your boss unless you’re sure they prefer it. “Hugging often decreases as one climbs the ladder,” said Mertel. This can vary between companies–Bennett noted that in startups and creative companies, hugging as a greeting is more accepted. But of course, if you’re not sure where your company falls, a handshake is the safest bet.

Know the greeting customs of the country you’re in. According to a New York Times travel guide, “air kissing” is common, even between strangers, in Latin America, Europe, and the Middle East, while handshakes are expected in Russia and Scandinavia, and a bow with palms together suffices in south Asia.

Mertel recommends reading up on the culture of a place you’re visiting before initiating greetings there, and playing it safe when it comes to greetings you’re not familiar with. “I observe that in cosmopolitan cities such as New York and London that an ‘air kiss’ on the cheek is acceptable,” she said, “but allowing the other to make that move first is best.”