These things have probably been discussed thousands of times. When gambling, one must set a goal, like limiting ourselves based on wins and losses. For example, even if I keep winning, I would stop after 3 wins. The same goes for losing, if I keep on losing, I must stop playing after a certain limit. But many gamblers fail to follow or even set this simple rule and end up losing their entire bankroll. Without a goal in mind, you arree doomed for sure.
Also, you need to mention such goals need to be realistic and within the scope of one session, otherwise we all will continue to lose all our money in a single session with little left to do but to regret our choices. There are people who log into casinos and deposit their money, with the expectation of making a little fortune, let us say, turning one thousand dollars into half million dollars in a single session.
One needs to be aware there are situation in which one doubling one's money is already a pretty good position to decide to log out and withdraw our money from the casino and spend some of it.
But the sad reality is what you said, most of us deposit without a limit in mind and as a consequence we end up losing it all, because we believe there is chance to get "infinite" money out of the casino in one or two sessions, when in reality it is all an illusion we create to ourselves, expectations which are nearly impossible to bring to reality.
People with this kind of mentality would surely face consequences, bad ones to be precise. Gambling can never be taken as a source of unlimited supply of money. It isn't and it's the bitter reality. You play, you win some bets, lose some bets, have some entertainment, or maybe relieve yourself from stress and move on. And if you are lucky enough, you might win a jackpot. This is my perspective about gambling. But some people like top think that it is some kind of money making machines, where you drop some and get an ocean of it. Lol