The best solution is always related to money management. You must avoid to be tricked by your emotions. I have zero emotions when gambling.
This means that a lose or a win bet have the same result on my mood

Play like you're trading.
No favorite team. No superstition. No random / lucky numbers for your jackpot. You must play in a "mathematical" way.
This will include some easy solution for your gambling:
- have a budget!
- use cold wallet!
- play only games that you know well!
- register result of your session, this allow to understand how you're performing.
Having zero emotions when gambling, in my opinion comes from dealing with a lot of losses in previous experiences, it seems I'm at that phase now.. I'm not really bothered when I lose because overtime I have gotten used to the feeling and I have also learnt to manage my risks carefully...