I use a philosophy that I had used when I quit smoking.
Basically, you go on this strict diet for a full day. The next day, you keep reminding yourself "I've endured the past 24 hours. I cannot simply put that all to waste". As you continue on the diet for the remainder of the weeks and months, you tell yourself "I've endured the past XX days/weeks/months. I cannot let that all go to waste now".
Basically, look back at your progress, and remind yourself that it'll all crumble once you stay off - course. It certainly worked for me when it came to smoking. There will definitely be hard times, where you would think that you are going backwards and that there is no progress, but you need to hang it in there; for your future well - being