A range of things help me:
I have no off-button, so I don't have treats I like in the house. If it's not there I can't eat it.
Weigh every morning, easier to deal with a 2lb increase than half a stone that has crept on.
Make it easy to control portion size - instead of faffing about weighing everything I use easy measurements when serving (eg small measuring cup of porridge oats, 2 tablespoonfuls of cooked rice). I always eat off a salad plate so can't overfill it.
I occasionally allow myself some treats in moderation so I don't feel hard done by. But controlled. For example, I love Christmas cake, but instead of buying a big one (which I would eat all of!) I buy one of the mini ones and have a little bit of it each evening for a few days. It gives me the taste and treat sensation without going overboard on calories. And it feels more like a treat!
I've realised that having a bad day (or week) does not mean you've blown it and you just give up. Just start again the next day.
Fasting has really helped me. I've realised I will not keel over if I miss a meal. If my weight creeps up I do 5:2 until it comes back down again.
Exercise helps, but it doesn't have anywhere near as big an impact as the food you eat. So I exercise for fun/mental health but don't count any calories burned. That way if I have a day that I don't exercise it's no big deal and if I do exercise it's a bonus. Takes the 'burden' of having to exercise away.
Being accountable helps me as well. I post on one of the weight loss threads on MN and it helps me be determined to stick to it better when I've posted and told everyone what I've planned for my menu on a fast day. Lots of great advice and support from lovely people as well!
It is hard and I'm still trying to 'reset' a lot of bad habits I'd developed over the years, but I feel so much better in myself when I'm at a healthy weight, so I try to keep reminding myself of all the positive things that make it worth it all!!