If you’re playing against the house yes, statistically you’re gonna lose over time. But in games where your winnings come directly from beating others rather than pure luck (poker is a popular example), you can indeed beat others based on your skill.
That said, there are still a lot of factors you cannot control (like the skill of your opponents, luck of the draw) which mean your approach is absolutely the wisest. Anyone who walks into a casino with money they can’t afford to lose is setting themselves up for failure (both at the table and potentially in life).