It doesn’t take time. It takes repetition. The more often your perform the habit you want to form, the quicker it sticks to your processes.
So, there’s no rule of thumb that it would take 21 (or any certain) days to build a new habit.
Your new habit may require you to repeat it 200 times before it becomes a habit. Then repeating it thousands of times can make it a natural process like covering your mouth while yawning. You will barely notice that you’re doing it.
It could take a lot of days to get this number of repetitive actions but you’re more likely to get there sooner if you do it more frequently… and regularly.