Habits — at least good ones — exist so we don’t have to resist temptation all the time. Imagine if every morning you had a debate with yourself about eating cake or cereal for breakfast. Instead, most of us form the habit of eating something relatively healthy for breakfast, which bypasses the lure of the cake altogether.

That’s why it’s sometimes easiest to start or break a habit during a major transition. This may sound counterintuitive, but a new house, job or relationship breaks old patterns, said Gretchen Rubin, author of the forthcoming book, “Better Than Before: Mastering the Habits of Our Everyday Lives.”

“People say wait a few days to get settled, but don’t,” she said. “Start right away."

MYTH 2 We fall back on bad habits when stressed. In fact, good habits persist even in times of high anxiety, Professor Wood said. A study of which Professor Wood was one of the co-authors found that students who already had unhealthy diets would eat junk food when stressed, but those who already had the habit of eating well — or of reading a newspaper or of going to the gym — were just as likely to do that.

MYTH 3 It takes about 21 days to break or make a habit.

That number seems to have cropped up in the 1960s and somehow became “fact” with no real proof. But in 2009, researchers in Britain decided to take a deeper look by studying how long it took participants to learn new habits, such as eating fruit daily or going jogging. The average was 66 days.

But individuals’ times varied greatly, from 18 days to 245 days, depending on temperament and, of course, the task involved. It will most likely take far less time to get into the habit of eating an apple every afternoon than of practicing the piano for an hour a day.