Was in a city today far from home, and a friend and I ate dinner at a casino buffet. The thing that best helps me to throw cold water on thoughts of gambling is just looking at the basic math of it.
Reality: Let's say that you spend $20 on a bet in a venue that takes a cut, such as a casino, you have a greater chance of losing the $20 than doubling it. Yes, a person can come out ahead in a short term, but the long-term result of continued play is always economic ruin. It's hard and cold, but it's reality. To try to get an emotional uplift from such an activity(which is what all of the patrons are attempting, let's face it) will be futile. It is destined to end badly.
Gambling at a casino is like playing cards where one of the players is allowed different rules, and they can legally cheat, but you can't. Who would want to play with that person? No one thinking rationally. If we can hold on to rationality and release cognitive distortions, it helps a lot. I agree with those above who point to mindfulness and staying in the present as the best cognitive approaches. Gambling is very much stemming from worries about not being good enough, about guilt and fear.