The quote coming from William James seen below is from an article in Brainpickings It is well worth a read all the way through if you are interested in all things to do with habits.
I’ve been thinking rather too much about habit today, mental habit to be exact. Sitting down for formal meditation this evening I made a deliberate decision. In my mind, I thought, ‘I could think about what to cook for Saturday lunch, but I’m not going to’. It is amazing what making a deliberate choice can bring about…..
Just as, if we let our emotions evaporate, they get into a way of evaporating; so there is reason to suppose that if we often flinch from making an effort, before we know it the effort-making capacity will be gone; and that, if we suffer the wandering of our attention, presently it will wander all the time. Attention and effort are … but two names for the same psychic fact.
Keep the faculty of effort alive in you by a little gratuitous exercise every day. That is, be systematically ascetic or heroic in little unnecessary points, do every day or two something for no other reason than that you would rather not do it, so that when the hour of dire need draws nigh, it may find you not unnerved and untrained to stand the test. Asceticism of this sort is like the insurance which a man pays on his house and goods. The tax does him no good at the time, and possibly may never bring him a return. But if the fire does come, his having paid it will be his salvation from ruin.
William James on the Psychology of Habit found on the wonderful Brainpickings website.