When you ask Google how long it takes to break a habit, you’ll probably land on a number between 21 and 28 days. This number is not grounded in scientific evidence at all.
When I have been working on changing a habit, I always used the number 40. I was always struck by the repetition of 40 days in spiritual literature; Jesus wandering in the desert for 40 days and 40 days for Lent. Although 21 seemed to be the popular number, it never felt long enough to me.
We have research showing that the average time to shift a habit is 66 days, although there is some variation depending on the person and the pattern they are trying to break.
They found missing the odd day here and there did not substantially affect the long term result, but being diligent in the beginning helped to engrain the habit faster.
Good luck with your habit-changing!