Get the latest Science News and Discoveries
Research: Habit formation involves 6 principles. Habits don't depend on goals, are cued by context, learned through repetition, automatic, & promoted by rewards. Also, can take a short (e.g. about two and a half weeks) or long time (over 36 weeks), depending on complexity, how often practiced, etc.
Or read this on r/EverythingScience