But when gambling already occupied you for quite some time and your mindset is that one day you'll win against the odds, then it's hard to break that habit and hard to find a new hobby to occupy most of your time. With it, you'll need to consult a psychiatrist in regards with your problem or take a family member's advice about your situation.
CS:GO and Dota 2 are the online games I play to divert my attention from gambling. It is really a good game to prevent you from checking out a gambling site and spending some money to it (though I must admit that I spent already a couple hundred dollars on both games just by opening cases and buying immortals and such.)