Short Term Rewards and Long Term Consequences

Extensive study has been made in psychology that shows the importance of delayed gratification in cognitive health.
"Delaying gratification is a process of scheduling the pain and pleasure of life in such a way as to enhance the pleasure by meeting and experiencing the pain first and getting it over with. It is the only decent way to live." -M. Scott Peck
Morality has the notion of temptation as a central theme, and their rules are designed to create conditions and incentives that avoid them.
As such it should be a well-understood by anyone with a brain if they would like to operate it with any degree of proficiency.
Temptation and Delayed Gratification
Temptation and Delayed Gratification are two sides to the same coin. When resisting Temptation, you eschew short-term pleasure to avoid negative consequences in the future (usually addiction). With Delayed Gratification you do the same in order to obtain a greater reward.
The manosphere is rather obsessed with this topic so if you research it on social media be careful not to go down the wrong rabbit hole.
Marshmallow Nuance
Further research on the marshmallow test has shown that how much the child trusts the person who promises to come back later with two marshmallows make a big difference in whether they eat the marshmallow or not. Children who lack trust due to high ACE simply don't believe that the researcher is going to follow through on their promise. This doesn't negate the findings regarding delayed gratification, but it does require more nuance when interpreting the experimental results.
Hidden Brain - When to Eat the Marshmallow
Hidden Brain - You, But Better
Short Term Pain and Long Term Rewards
Related to this is the concept that our most difficult experiences tend to be the most meaningful. Our brains gives us a ton of happiness when we push ourselves to our limit and discover an ability to persevere and accomplish things we thought were impossible. Even though the experience of accomplishing may be painful, the sense of accomplishment lasts a lifetime. Learning to pursue challenging goals in pursuit of greater long-term rewards depends on the same neural circuitry as delayed gratification. See types of fun.
Hidden Brain - Doing It the Hard Way
Tempting Music
Musicians are excellent examples of delayed gratification. They toil away for years playing scales over and over in order to receive the massive accolades that come when your virtuosity is recognized.