This methodology has worked for a lot of people, but major problems can arise with habit forming when it isn't done in the right way, and the above approach as a methodology for forming habits is completely wrong. People think that "Do something for 21 days" is a method of actually creating a new habit, then they try to actually implement this change and it doesn't succeed.
The issue is that changing a habit takes motivation and motivation is very temporary. In fact, for most people, motivation lasts less than 24 hours. How can you be expected to devote time every single day to a singular task for three whole weeks if your motivation for changing this habit is only going to last 24 hours maximum? Why is motivation such a fleeting thing and how can you overcome the reality that yours won't last?
The answer to these questions actually comes from the psychologist Bandura who developed a theory about motivation. According to him, there are 3 types of motivation - personal, social, and structural. Understanding these three types of motivation is the key to starting or removing any habit from your life - you have to change your motivation.
Personal motivation is whether or not you want to do something. Personal motivation and willpower are pretty similar - just because you want something right now doesn't mean that you will later. Social motivation is whether or not the people around you are supporting you in the change you're looking to make - more about this in a moment. Finally, structural motivation is whether or not the systems are in place to actually facilitate the activity.
Let's take an example - you want to be an excellent chess player. You decide that forming a habit of studying chess for two hours each day is a great way to start improving the way you need to. You know that you can accomplish this in 21 days, so you give it a go. This may sound like a recipe for success, but without the proper motivations in place, you're likely to lose focus. Your personal motivation (I want to be a chess player!) can only last for so long - you need other types of motivation to sustain your effort levels.
Social motivation could come from a parent, friend or family member who checks on your progress, plays chess games with you or holds you accountable some other way. Having a network of people supporting your success is a strong social motivator for continuing a behaviour. Structural motivation comes from a wider support system of tools to get it done - a chess app on your phone, chess board, membership at a chess club, having books about chess and being around people who play are all great ways to ensure that you stick to your goal and get immersed in the game.
Implementing the correct system of motivations makes it almost impossible to fail at most tasks - you have to create a system that enables your goal and holds you accountable for reaching it. Where most people come up short in trying to use the 21-day program is that they don't make big enough changes to actually hold themselves accountable, so they end up giving up far before they reach the 21 day mark.
Here's another example - Stan wants to start waking up early and meditating every morning at 6. Stan knows that if he does this every day for 21 days, it will become a habit and he'll be in the clear - he's motivated! Unfortunately, Stan needs to hang around with friends after work each day to relieve stress, and he's used to going to sleep by midnight and waking up at 8am. Stan wants to wake up two hours earlier, but he'll actually need to break the habit of staying out late with friends in order to facilitate that habit, otherwise he'll be too tired and lack the personal motivation to get up. Unfortunately, the social motivation created by Stan's friends encourages him to stay out late drinking, so we need to get rid of this strong force in order to help him wake up early.
As we can see, Stan has competing motivations in his life that he hasn't addressed, and until he does so, he'll find a lot of influences in his life that negatively impact his goal of waking up early every day. Routines are difficult to disrupt and it's important to consider which routines you're disrupting when you start trying to add new routines. Make sure that your new routine is properly supported by your environment and find someone or a group to hold you accountable to your goal.