A practice that everyone should learn and used to avoid gambling addictions that can lead to worse things to happen in life.
In practice, it would not be easy to learn and maintain because, in gambling, one's emotions could escalate easily. This can make him let go of those restrictions slowly and in the end, he uses no restrictions on gambling.
The majority of gamblers who don't apply this method are novice gamblers or gamblers who only pursue victory, but I'm sure from time to time they will come to their senses.
It is true what you said that in practice it will not be easy, especially if the added emotion arises, it can be more difficult to have predetermined boundaries.