This is easier said than done. Most gamblers lack proper self-control due to which they end up gambling away their funds in the long-term despite being aware of all the stuff that you mentioned.
The ones who possess great willpower are few and far in between and they minimise their losses/win against the house in the long-term.
It's hard to control ourselves and if it is something related to money, greed, emotion, it's harder.
We always have choice and chances that allow us to experience a thing like Trading, Gambling or Investing. The key note is trying with small money, if you fail many times, it's time to seriously thinking of stop doing this again.
So if a person failed many times with Trading or Gambling, it's time to stop it and consider other things like long term investment.
Life is like an endless Learning from trials and lessons but make sure we don't ruin our life with trials and failures.
This is good advice, but only a small percentage of gamblers can take the advice well.
we don't need to talk about people who have talent and expertise in gambling, because usually they can make a profit from their gambling. However, people who gamble without skill usually always lose their money, and in general people like this are difficult to advise.