Weight loss, keep going


I started the weight loss program and my results are not as good as expected.
I took a few grams even though I’m following my protocol.
Now I have a lot of thoughts coming through my mind: I am not good enough, I will not manage to lose the weight etc.
What should I do to get my thinking back on track in these moment when it’s not working as I would like to ?