you could stay away from online gambling by keeping less money online. So even if you lose you don't lose much.
To stay away in gambling needs a lot of discipline, you need to be more focus on doing productive things that would affect your life in a positive way in the future and never gamble if you can't handle the stress it brings unto you.
Yeah, dicilpline and commitment to yourself to stop gambling and i sucess doing that and makes me to not gambling anymore. Do something outside from your home is a good one too.
This advice is kind of irrelevant since when someone has a gambling problem or other addiction its usually because they dont have an discipline and commitement.