Eliminate all sugars and most carbs from your diet, and lift weights. Pay attention to how you feel, and learn to differentiate between cravings and real hunger. Ignore cravings and eat when you're hungry. If you can't easily control the composition of your diet, then calorie count. That 3rd slice of bread loses its appeal once you realize it will blow up your daily budget before 3pm. Don't "reward" yourself with cheat days to look forward to, but rather schedule in days with a bigger budget, or give yourself a weekly use-it-or-lose-it bonus budget to eat into. If you're doing the calorie counting, then be diligent about it. If you do it every meal it becomes effortless, but if you allow yourself to skip it for one reason or another, it won't become a habit.
You're going to have to get used to some amount of discomfort to lose weight, whether it's physical or mental. The sugar cravings subside after a week or so, but you have to cut it out like it's poison. Sore muscles from lifting hurts, but it's a mark of accomplishment. If you use food as a comfort, you're going to need to rewire your brain to not do that anymore.
The low carb diet or calorie counting literally causes you to lose weight, but it's a means rather than an end and it takes discipline to sustain long enough to get meaningful results. If you stop and fall into old habits, you'll just gain the weight back. The purpose of the weight lifting is to build up muscle so that your metabolism changes. You may end up the same weight as when you started a year later, but you'll carry the weight differently. The exercise also releases some pleasant hormones that make you feel good, and helps you get in touch with real visceral hunger. A sugar craving is mindless and hollow, "oh let's just open up this cabinet and grab an Oreo. One won't hurt even though it's bad for me. What, the bag is empty?! Now I'm sad," while exercise hunger has some primal depth to it, "I don't care this can of tuna is expired, it's the most delicious thing in the world right now, and eating it will make me stronger than I've ever been. I'm glad I live in a society, because otherwise I'd be in a river trying to punch a salmon unconscious right now. Who am I kidding, that would be awesome."