Glad you asked...
First and foremost, realize that sometimes, despite our precautions, what we say will make someone else feel bad. We can't control other people's responses. There is no "good" way to tell someone they stink, their dog just died, or they're being sued for a million bucks. But some ways are better than others. With bad news, the goal isn't to eliminate the pain, it's to reduce it as much as possible.
That said, how do you minimize the pain? Have you ever seen a little kid fall? If the adults around him or her make a big deal about it, the kid will cry. But if the adults are cool, laugh, and act as though nothing is wrong, most of the time the kid will just keep playing. Use the same approach with stinky people. Be direct, but discreet, don't make it a big deal, and lay it on them gently. I had to do this once... I blamed the person's clothes, not him!
The conversation went something like this...
- Hey (insert name here)... can I talk to you about something?
- Sure. Shoot.
- Well, I've noticed that sometimes, maybe at the end of the day or something, your clothes smell a little like you've been running around all day... Just thought I'd mention it before it became a problem. It's not that big a deal, but you should get a handle on it.
You might add a disclaimer that you're just looking out for that person, that you're sorry you had to bring up something that's difficult to hear, but that you're glad your friendship can bear uncomfortable moments and become stronger as a result...
If you're really afraid though, try offering the person gum or colgne/perfume first. If they don't take the hint, then talk to them or move out of their neighborhood...