When beginning a new diet, you are primarily dealing with a change in habit. As the 19th century, Scottish writer Samuel Smiles mentions. "To uproot an old habit is sometimes a more painful thing and vastly more difficult than to wrench out a tooth.”
Behavioral scientists Bas Verplanken and Henrik Aarts have a definition of habits. It is a learned sequence of acts that have become automatic, unconscious responses to specific cues or triggers around us.  So when adopting a new diet, we are looking to break an old habit and build a new one.
Our habits make up a large chunk of our daily lives. A recent study on habits focused on examining the diaries of students and community members. They concluded that up to 45% of the activities and tasks we undertake in our day are habitual. 
Before you start any diet, make sure you have figured out your eating cues. This can be much easier said than done. Samuel Johnson says, "The chains of habit are too weak to be felt until they are too strong to be broken." Prepare yourself to become uncomfortable. Identify all the little cues that quietly trigger your present diet. Identifying their presence is the first step towards changing any habit you are looking to improve. Take the example of making coffee.
We have come to associate a "good" morning with a hot mug of coffee. The cue here might be the morning light or the alarm going off or a cafe that we pass by on the way to work. These triggers are harmless by themselves but lead to us being reminded of the aroma of coffee, and that begins the cycle. These are associations we have built over a long period of time. A study conducted by Phillippa Lally and colleagues at the Health Behaviour Research Centre at UCL in 2009 looked at the time it takes to form a habit. They found takes anywhere between 18 days and 254 days to build a new habit. The average time was 66 days. 
Notice that every habit is also associated with some reward. It is this reward that motivates one to keep repeating the activity and building the habit. The reward is what fixes the behavior in place and makes it a habit.  The connection is so strong that after a while, we don’t even need the reward. Just the memory of the reward is enough to make this behavior automatic.
Here are a few other things that would help you on your way to sticking to your diet.
1. Define your Destination:
If you want to stick to a diet, first define exactly what diet is right for you. We tend to follow fad diets that may work for a little while, but most of the time, end up letting us down. There is no "universal" healthy diet. Figure out what your body needs and what's going on inside your gut with Viome's Gut Intelligence Test . Knowing where you're heading makes the journey much more enjoyable.
2. Find a Role Model:
While a diet-chart might look pretty fancy on paper, you need a real-life role model to see and feel the difference this diet could make to your life. It could be as simple as a friend who sticks to his/her diet day in and day out.
3. Keep it Simple:
One mistake that most people make with new diets is to switch too fast too soon. Keep in mind that the body will take time to adjust to this new diet. So once you have your type of diet selected, break it down into simple parts or steps to tackle one by one.
Remember that every massive feat starts with one small baby step. Taking things slow ensures that you can stick to it and accustom your body to this new shift in eating.
Try starting with your new diet rules for just a single meal of the day: Breakfasts are great for this! Since it is the first meal of the day and you are pretty hungry, it should be easy to get oriented eating just about anything.
4. The Time Game:
Try the diet for a day and then revert to your usual routine. Try again after a few days and stay on for two consecutive days. And then for three days. Warm up your body and mind to accept this new diet and become at ease with it.
5. Make it Easy to Follow:
Ensure that you have stocked your home with everything that you would like to be eating when you are on this diet. More importantly, make sure to get rid of anything that you don't want to be eating during these times. If you don’t want to discard, simply put the food in a place where you can't spot it easily. [7,8]
6. Mindful Eating:
Take time out for each of your meals. Ensure that you are in a calm environment with no distractions. Focus all your energy on just nourishing yourself, and nothing else. Pay attention to every little morsel of food and savor it.
A study conducted on obese women observed them practicing mindful eating. They had significant improvements in their relationship with food over the course of 4 months.  Another study on mindful eating showed binge eating episodes decreased from 4 to 1.5 per week. Moreover, this happened in only six weeks. 
7. Keep Track:
Before you begin your experiments with the diet, start keeping a food journal or a calendar. It helps to have a visual representation of your new habit. Just watching your progress on paper can motivate you to continue. At times this would act as a reward too! Knowing you can stick to your new diet for five days straight would now give you the confidence to stick to it for a longer period.
8. The Contingency Plan:
Be ready with a Plan B when the cravings kick in. Make sure you have back up recipes, ingredients, and snacks at hand. This ensures if you aren’t able to manage your cravings at the last minute, you don't go completely overboard but just take a mild detour.
If you end up jumping to Plan B, remember to jump right back to Plan A the next day. Don't be too hard on yourself or give up the whole diet because one meal went out of hand. You can always spring right up and steer back on to your eating plan.
Ensure that you rewarded yourself for sticking to the plan. The reward could be as simple as checking your weight and being satisfied with having lost some. It could be a treat at your favorite restaurant! It is important to acknowledge the grit and determination you have sticking to the diet. Recognizing this helps you be more confident in your will power the next time.
10. Take Support:
While it might seem insignificant while starting, this is one move that will help you in the long run. Pair up with a friend and do it together. Being accountable to one another makes it easier to be true to oneself and the practice. Besides, it is best to be guided by someone who has been through this before.
Quinn, J.M., & Wood, W. (2005).Habits across the lifespan. Unpublished manuscript, Duke University; Wood, W., Quinn, J.M., & Kashy, D. (2002). Habits in everyday life: Thought, emotion, and action. Journal of Personality and Social Psychology, 83, 1281–1297.
Lally P, van Jaarsveld CHM, Potts HWW, Wardle J. How are habits formed: modelling habit formation in the real world. Euro J Soc Psychol. 2010;40:998–1009
https://www.ncbi.nlm.nih.gov/pubmed/21977314/ Mindfulness Intervention for Stress Eating to Reduce Cortisol and Abdominal Fat among Overweight and Obese Women: An Exploratory Randomized Controlled Study.
An Exploratory Study of a Meditation-based Intervention for Binge Eating Disorder.
https://www.ncbi.nlm.nih.gov/pubmed/16418755 The office candy dish: proximity's influence on estimated and actual consumption.
Home environment and psychosocial predictors of obesity status among community-residing men and women.