I agree, but I would add one very important thing:

If you consider the diet/lifestyle that allowed you to lose the weight as temporary, then you will fail.

I would diet to lose weight by stop eating sugar and desserts. Then, when I got to my target weight I would say “ok, one dessert a week” and before I knew it I was having them every day. And before long I had gained the weight back.

Currently down 21 lbs and 6 months free of sugar. This time I view it as something I will do for the rest of my life.