I give myself two days a week where I let myself indulge in my cravings (not completely, just one small portion of one thing I really want). I feel like I'm only living once, if I really want a few bites of that cheesecake, why not? But you have to make sure you're control, because it can be a veryyyy slippery slope.
Another option is, really think about your craving, and find out if there is a healthier solution to it. A few of my examples:
Pizza. Instead, why not get some very thin flat bread, and put some seasoned vegetables and tomato sauce on top, then a sprinkle of cheese. Then heat it up and enjoy
Ice cream. Graham cracker and a little low fat whipped cream. Or (and healthier), blended frozen bananas with a little almond milk (yummm).
Chips. I make homemade sweet potato chips instead. Thinly slice a sweet potato, add some herbs and a tiny bit of salt, drizzle with a small amount of olive oil, and throw in the oven.
And for chocolate, I just eat a tiny piece of dark chocolate.
I find that restricting too much often can cause diets to fail, at least for me. If I've been too strict, I often find myself binging which is far worse than the small indulgence every once in a while
Edit: Another tip! Drink a glass of water or tea any time you're hungry. Sometimes when you think you want food, it's really your body telling you it just wants more water!