We have habits in all areas of our lives. From working out, when/what we eat, who we hang out with, how we spend our time and more. It is possible that changes such as moving, going through a breakup, starting a new job, etc. can cause us anxiety since they break our current routines. As we get new routines, new habits, we start to feel more comfortable and less anxious. This is why people say give it time.
There have been many studies on creating habits. The two most common were the 21/90 rule and a finding that says it takes 66 days for a behavior to become automatic. They found that this can vary from person to person and depends on the circumstances. The 21/90 rule says it takes 21 days to make something a habit but takes 90 days to make it a permanent lifestyle change.
So, if there is a sudden change in your life, give it 21 days. After this you should start to feel new habits forming. Around 66 days you should notice your habits are consistent. In 90 days it will become a part of your lifestyle. This can be comforting to know- especially if the changes you are dealing with are causing stress or anxiety.