Understandably, many people are reluctant to take on this difficult conversation. "Couldn't I just send an anonymous note or leave a hint like a stick of deodorant?" While easy on you, it would be humiliating and hurtful to your friend to receive such a note. Now is the time to be a good friend. Before approaching him, have these goals in mind:
You might say, "Tom, I'd like to talk to you about a difficult issue. I hope if the situation were reversed that as my friend, you would talk with me. Are you aware that you have body odor?"
Now that you've done the hard part and broached the subject, be sympathetic and supportive. If he reacts angrily, assure him of your friendship. Often when this happens, the person will come back and thank you once he's thought it over.