Distinguish between desire and deprivation

I have lost a lot of weight since I started my weight loss journey and I often get confused about what is truly deprivation vs desire. Yesterday, I had a cake for dinner which I shouldn’t have because i still have 10 more lbs to lose. But the fact that I lost 30 lbs made me feel like I should eat it and reward myself. Plus, the cake was bought by my mother and she insisted that I eat it . I did and I felt bad about it because I feel that’s junk food and will make me gain weight. Is my thought unhealthy? How can I not beat myself up for it? How can I lose that last 10 lbs? It’s getting so much harder to lose that last 10 lbs.