When I gamble, I budget a certain percentage of my monthly earnings. This is usually an amount that I don't get upset if I lose this money. This way, I can avoid possible losses. But after winning, the situation is a little different. I gamble by taking bigger risks, saying that I won anyway and this money was not mine. I think the important thing here is that after you win, if you lose, you don't gamble more to make up for your winnings. This way you will avoid the losses you have identified. The most important thing is to set time and budget limits for gambling. Maybe even keep a gambling diary.