You will need
In order to hug a guy, you need to reach a certain level of relationship with him. That is, at the very least, you should be familiar and from time to time to chat.
Stand or sit next to the guy. Try to minimize the distance between you, to be able to touch him. But don't do these maneuvers is obvious.
To hug the guy, during the meeting maintain eye contact and often smile. If he would smile in response, then there is a good chance that you also like him. Although even if he did not answer a smile - do not despair. Maybe he's just shy.
Tap a couple of times to his arm (or leg if he's sitting). Note how he reacts to these touches. Wait for the right moment for cuddling. If you are Dating, for example, during a football match, wait until your team scores a goal, and you can easily embrace the guy in a fit of joy.
Then apologize for your actions, pretending that the hug was an accident. Say, for example, that you are so rasperezhivalas that it happened by itself. If you give him cute, then most likely he will say that everything is in order, and he even liked it.
If, for example, along a walk, in order to hug the guy, you can mention that you are cold. It can offer you warm in his hands. If he does, you can reply with your hugs as thanks.
If you spend time in the company of friends, you can jokingly hugged him amicably. Just don't make it too romantic. If he likes you – he, too, will prinimat in response. And who knows what the outcome of these friendly hug.