If you adhere for 3 days and slip the 4th, that’s at least 75% adherence. 75% better than 0% adherence. Everyone slips.
See Dr Doug Lisle for good background on making and breaking habits.
The Pleasure Trap (TEDX 17m)
https://m.youtube.com/watch?v=jX2btaDOBK8The Pleasure Trap (Vegetarian Society of Hawaii 58m)
https://m.youtube.com/watch?v=nxf4kj8Rb6YKey is immediately getting back on plan. Then review specific situations that trip you up, and look for suggestions how to handle.
For late night snacks I like bananas or leftover oven fries. Less likely to cave to craving if full. Starch helps keep you full.
Better to snack on whole food plant based dessert than junk from gas station. You could make desserts from healthy ingredients like oats, sweet potatoes, black beans, bananas, apples, dates, etc. Black bean brownies or sweet potato or pumpkin pie squares are a couple of my family’s favorite dessert-snacks.
Don’t make eating more restrictive than it needs to be. Small amounts of sugar and salt are allowed, and can be difference between adherence and not.