When you're playing and you get the feeling you want to gamble, you get that excited feeling that defies the logic your brain is telling you to do such as re-raise instead of call, or raise instead of check, then you need to identify that feeling and just auto-fold the hand. You are not in your right state of mind to be playing. Punish yourself by playing extra tight for quite a while until the gambling addiction style feelings subside and you can go back to playing good solid poker. Being able to identify those feelings is good, now it's just a matter of learning how to control them.