pellaz is totally right. Before you can stop or at least decrease the un-wanting behavior you need to take care of what causes the behavior.
So you said you hang out with friends, okay, they offer a beer, fine one is okay. Sip on it, grab a glass with some ice in it, and sip on it. This way it decreases you from having more than what you actually want. And gosh don't be afraid of saying "Listen dude, I'm trying to cut back from the beer, I appreciate you offering it, but I'll take some Ice-tea instead" or something of that nature.
Man when I stopped drinking soda, about a few years ago, I totally didn't have any soda in my house. When I go to other people's house, I take juice, ice-tea at restaurants (I went from sweet ice-tea, to un-sweet ice tea now), now I don't even LIKE SODA! I can't stand it, I get headaches when I drink even one can! so I avoid it all together.
When you're playing x-box, make a BIG mug of ice-tea and drink a glass instead of the beer.
I'm advocating ice-tea (sweet, but more so un-sweet) instead of diet-coke or soda. Matter of fact, soda whether it's the real thing or diet, is both bad for you. You might as well forget the diet, and just go with the real thing if you wanna drink soda.
But you obviously need to first discipline yourself before you can actually stop it.
It took me about half a year to fully realize that, wow, I don't need soda, I don't want it, and I don't care for it. O.o' Obviously on special occasions you'll want to indulge into a beer for the social part of the event (Such as a birthday, Christmas etc..) but again you need to limit yourself, and you need to know when to stop.
Good luck!