What about when I'm tempted?
It is okay and normal to be tempted. Let's get that in the open first off.
Being tempted is not the same as doing the thing you're tempted to do. And it doesn't mean you have to do it. Often when we're trying not to gamble, we suppress the temptation to gamble.
Here's a thought. Next time you're tempted to gamble, then instead of dismissing it or trying to ignore it, do something else. Ask yourself "What is this temptation telling me?". Almost always, you will learn something valuable about your feelings or thoughts.
If you ask "What is this experience telling me?" then you might find you are worried about where your money will come from, be stressing about your debts, want some escapism from a stressful family situation. Gambling won't be the answer to your situation.
Try it next time: "What is this experience telling me?"