A large amount of it is managing the delay of gratification; I believe that is what you mean here. It is a discussion in psychology, and you can find a bunch of research on it for instance the marshmallow test.
I would challenge you to do some meditation- like just stopping and relaxing and focus on just your breath, once a thought pops into your head just come back to the focus on your breath. Try it for 2 weeks 5-10 minutes a day record your results.