When you want to hug someone, look at them, and look into their eyes. A pleasant smile or strong eye contact when seeing someone helps build a connection. When the other person maintains eye contact and the body language shows that they will hug you, grab their hand, or touch them when you are ready to engage in a hug.
When you are hugging a close friend, you are comfortable and know that your friend would be happy to hug you. But, when you are hugging someone you don’t know well or someone you have not hugged before, give them signs that you are trying to hug them.
When you are approaching them, open up your arms, if they do the same, hug them. If they shake your hand and then move away, respect their boundaries, and don’t try to hug them. If they ignore you and don’t hug, they might not have noticed that you wanted to hug them, stay graceful and polite in either situation.
When someone is feeling sad, stressed, or is crying, ask them if they need a hug. If they are very upset, go near and extend your arms, if their body language shows they are interested to accept a hug from you, go on.
Take a deep breath and give them a warm and relaxing hug. Hold them tight but not in a discomforting manner. Keep hugging them until they are ready to let go. Hug for at least 20 seconds and rub their back or arms. Rubbing the back helps release physical stress and reduce stress.
Most people value their personal space. If you want to hug someone, be sure to ask first, or to read their body language to see if they'd be okay with hugging you. Unless you're really close with someone, never hug them by surprise.
If a person's body language is closed off, and they don't seem to be interested in engaging with you, it would be best to not hug or even ask, as it would likely make them uncomfortable.
If a person's body language is open, and they seem interested and enthusiastic about talking with you, it is likely that they would respond positively to a hug. If you're not sure, then always ask first.