Take dice for an example we might assume that we can control and influence the result of it by throwing softer or harder or in anyway that our brain recognize a pattern and keep tells us it's a way to win the game.
I think people at first need to understand the term and definition of gambling. Gambling is all about luck and nothing else. No external factors can affect the outcome or result of gambling. So these illusions of patterns are automatically created by our brain to risk more and to earn more money. If by chance you get success, you will become delightful, but if you face loss, then definitely you will drive into depression. So gamble cautiously and look for all the possible outcomes before risking the money.