I think we all know that we need to have risk management and that we don't need to chase our losses but sometimes something just snaps in your head and you will bet crazy. The only thing that helps for me, is keeping a really low bankroll and using the vault system (but not all sites have that).
This is called tilt, I can admit that when I used to play poker and I suffered from a bad loss in which my opponent drew exactly the card they needed to beat me after I played my hand perfectly I could go into tilt mode.
However as soon as I realized this I just left as it is in those moments when you are inclined to make a major mistake, so if you feel as if you are about to lose control stop gambling immediately as those few minutes in which you cannot control yourself can be enough to lose all the money you have at the casino at the time.
There was a period, like 12-13 years ago, where I betted every night until 3 -4 am and placed random bets on live matches from like Poland and most of the times on sports where I don't really know a lot of it lol. Biggest tilt moment was when I kept on loosing and loosing and decided to go all -in (on a tennismatch of V. Williams). Luckily won my bet and realized it could have ended really bad so stopped gambling. Started getting active again a couple of years ago but just with very low amounts for fun and excitement.
Lucky you mate, if things turned to the other side for sure, regret is what you are sharing right now, but that's life and fate let you realize things and it's for your good.
Betting with limitations and with good responsibilities, it might be much entertaining and
enjoyable as you are not pressure with the outcome and you have that mindset that you
are not going to lose your control.