The fact you realized your problem is already a big step.
How to stay away from gambling?
- Always be busy with smth;
- In the moments of weakness always remind yourself about the negative experience of loosing money;
- Sometimes the best way to get rid of addiction is to develop another one. Extreme sports? Videogames? It could be anything (except for drugs and alcohol, of course).