The good thing about good habits is that they build a history of investment in that aspect of one’s life in the form of an unbroken run. This investment if continued for some time (even with pain) plays a central role in future continuation of the same because it becomes their identity.
For example, once an author writes a few dozen pages of a book, then they’re likely to finish it because they have done the initial investment and stopping the project implies that all their initial work has been wasted. Similarly, a person who ramps up a startup is very reluctant to shut it down because that would mean a complete waste of money, time and reputation during all the initial years. After becoming a vegetarian, a person is much more likely to continue avoiding the meat if he or she negotiates the first few opportunities to consume meat successfully.
It is possible to extend this concept in other ways. For example, if a married couple consciously handles their disagreements with respect for a set period of time and hold on to the relationship without a fight, it becomes so easy to avoid any conflicts later. This is because when a conflict arises, they can ask this question: is this issue important enough to end a months long peaceful run so far? Almost always, the answer is no. Then, these months of peaceful run stretch into years and then into decades. With emotions out of the equation, any potential problem can be solved by respectful communication with each other. Through this strategy, it becomes much easier to maintain good relationships with everyone around throughout our lives.