Pre-mortem
You've heard of a post-mortem examination. But what is a pre-mortem, and how could you do this for your situation with gambling?
A pre-mortem is a way of preparing for success - by imagining what you would need to do to fail spectacularly.
You can do this with any area of your life. You just need to imagine the very worst that could happen with this particular thing. Maybe it's a project at work, or an important exam, or a sports tournament you're participating in or coaching.
Whatever it is, you imagine the very worst outcome - and then visualise the steps that got you to that outcome.
By learning from your failure - without having yet failed - you gain hindsight in advance.
Try it with your gambling - imagine the very worst outcome you can think of, and then the steps that got you there. Then list these steps out on paper. Now that you have this knowledge, you can put things into place to stop the worst from happening!