Like everything else in life becoming a disciplined person is something that you develop slowly and you learn over time, so if you want to become more disciplined then you need to begin to try to do so in many other aspects of your life as well, so if for example your alarm clock rings and it is time to wake up you should not turn it off and sleep for five more minutes, instead you should get up immediately and without any protest, while this may seem small, if you being to do this in many aspects of your life soon you will develop discipline, and deciding a limit when you gamble and respecting it will become way easier.
There are many ways we can have good discipline, and you provide a good example of practicing this discipline. When playing gambling, we also have to have good discipline so that we don't gamble too much and always try to stay within limits. We can only try to learn discipline and even though it is difficult, we still have to force ourselves to have good discipline to be able to gamble within limits. We have seen how a gambler loses his discipline in gambling, which causes him to lose a lot of money. For this reason, we must continue to practice discipline so that we don't experience problems in gambling.