I think almost all gamblers have experienced something like this and they have also done the same thing several times even though they have experience and awareness that there will be defeat in front of their eyes waiting if they don't stop immediately.
Talking about stopping and leaving may be very easy because this is just theory but when faced with conditions like that anyone can get carried away by the atmosphere and forget the word stop before actually experiencing the loss of excessive amounts of money.
Stopping in the middle of gambling can be easy if you know your priorities. Once you won a certain amount, and you know it's time to stop, then stop immediately. Don't keep going and hope for more winning, don't be greedy and be proud to yourself that you at least won instead of losing. If you keep going, you might lose instead.