I used to diet all the time.. I kept going up and down
It's hard...
I found it easier when I started to exercise and I looked at what was making me gain weight in the first place... it all came from there. I began making small, gradual, and healthy changes.. and now, I'm not on a diet although I am losing weight.. I eat 3 meals a day and some snacks, I eat well rounded and not actually small or half-sized meals, and I exercise a few times a week. Plus I treat myself well, or try to when it's not so easy. And it's been working!
Something else that helped was looking at WHY I was eating so many foods that I knew weren't good for me (unhealthy foods, I guess the so-called "bad" foods) and what my motivation was for wanting to lose weight.
As for my motivation, in replying to your message, I realized that my perspective has shifted and my motivating force is to achieve having lost this weight. Yes I want to be healthy and I want to be active. I want to run, I want to be active, I want to join a sports team, compete maybe even... ! I want to look "good" (what I deem to be good), I want the ease of clothes/shoe shopping - right now, I'm having a hard time finding a shoe that will FIT.. nevertheless I like! And as much as I may love being able to wear all sorts of things that I think I'll look great in, it'll also be such a relief to not have the hassle of worrying I won't find clothes to buy when I am down to my last pair of this or that. I want all of that and more. But I also feel like I've begun a challenge with myself and I want to cross the finish line and feel successful by attaining my ultimate goal. In a way, it sounds like it's about the number on the scale, but I'm not taking any short cuts and I'm not using a stop-watch... my only stipulation is that I take the healthy route by eating well and exercising well.. so the overall goal may look like the number but it's about so much more than that.
Good luck! You can definitely do this and treat yourself well in the process