There's no two ways about this, since the op is asking about what should be done when we lose money in gambling, To me the best thing one should do here is just take a break, stop and re-evaluate your betting strategy , Try to study or know why you have been losing , if you are playing the right kind of game that you understand very well, because some gamblers just bet even when they don't understand how that particular game works, and lastly finding area of gambling you understands.
Gambling is not as easy as we think and precaution is very important so that we don't end up losing more than we have to bet on. Many people are making mistakes because they are not ready to calm down and gamble since their motive is to make quick profit in the market. We need to be prepared to make money by taking the right approach so that we don't still lose in gambling. Those that are making money frequently in gambling now are those that have made sacrifices at the beginning and have lost money and now they are enjoying making money because they are ready to observe and taking the right risk that would bring more money for them.
Well, sorry but you are absolutely wrong, specially with the last part of your comment, winning in gambling has nothing to do with how much a gambler have previously lost to the activity, if things worked in such a way that, those who have lost the most to gambling tend to win more over time, I am pretty sure that old time gamblers (including myself) will just retire from whatever work or business we are into, and by now, just relax and reap the fruit of our long years of loses to gambling, but unfortunately, things don't work this way, it doesn't matter how well experienced you are in or with gambling, if you re not lucky, you will not win, it does not matter how much you've lost before.
So, the best advice for us to always mind what we do, and how much we spend on gambling on daily basis, monitor our win as well as our loses, know when we are already losing too much and taking a break, so as not to end up losing money meant for some important things; to gambling.
And most importantly, it's best to see gambling as a means of having fun, and not a way to make money, for in the end, the chances of a gambler losing to the casino is always higher, so, seeing gambling as a way to have fun brings better peace of mind.