Actually, you will not feel various doubts in making decisions if you know and are aware of the risks from the start and if from the start you only use the amount of money you can afford to lose, so that defeat will not be a big problem.
You are right, the key is that we ourselves must be able to realize that we do not have to gamble excessively because there is a big risk that can happen and it will definitely happen. Usually people who are not willing to lose their money in gambling are those who always want to recover their losses and that makes them continue gambling without caring that the money that has been lost in gambling is quite large.
As you said, one of which is knowing when is the right time to start and when is the right time to stop, that is an ability that is possible for a gambler to have when they are able to use their experience as a learning material.
But actually I think a gambler does not need to have experience first to know what is right and what is wrong regarding behavior in approaching gambling, because if from the start they see gambling from a rational perspective in the sense of not only focusing on the chances of winning but also paying attention to the negative side, then they should know or be able to distinguish between which actions or approaches are right and which are wrong, you shouldn't get caught on the wrong path