Here are some general thoughts, that helped me. I took off a good bit of weight last Spring and I've kept it off and not going back. I'm still in the middle of this journey so I am far from a guru, but I really think the framing of how we each approach these lifestyle changes will ultimately determine whether they are successful or not. I will try not to speak definitively because everyone is different.
I did not approach it as a "diet". It was a "lifestyle change". It was a permanent way of living. I would recommend not undertaking any sort of a diet that you don't plan to stick to for the rest of your life. I mean of course it will evolve but it needs to be an entire mindset shift to this is how I eat/live now. Not I'm going to do IF for 3 months, drop 25/30 and then go back to my old ways. You need to live it into habit, though. It will take months and months but that's ok.
Do not fear "failure". There is no failure. It is not a linear process. 2 steps forward, one step back. If you approach it as a lifestyle change, when you fuck up, because you WILL fuck up, it's just a small set back. Get back to work. One binge should not cause you to give up. The lifestyle is permanent, the binge is the one off.
Calories, calories, calories. It's all calories when you boil it down. Count your calories. Know your calorie targets. When you exercise, don't add the calories back into your daily budget. Add half of them back into your daily budget if you need the motivation. You can even eat some of the shit you want. Just plan accordingly. It's math at the end of the day.
Weigh yourself every day (if you're trying to lose weight). Scale anxiety is real.
Food tips - water! Drink a lot of water. Eat a lot of food that has low caloric density, like fruit. Go buy a bunch of fruit and when you start feeling like you need a snack, eat some watermelon, grapes or an orange. The calorie counts in most fruit and veggies is negligible as long as you aren't slamming avocados and bananas at a breakneck pace.
Don't let yourself get hungry. This is when you make bad decisions. Eat before you get hungry. I would order pizza every night if I skipped dinner. Sometimes I do. If I ate even a simple bowl of fucking chicken soup I would not be hungry and not make a stupid decision.
Pre-planned/easy meals are great in this regard if you have low will power. Salads (add grilled chicken if you like, it's one of my go tos), pre-packaged or prepped meals. Basically make it easy on yourself to stay on the right path. My meals are between 3-500 calories.
Move. Every day. Find something that works in your daily routine and stick to it. I try to do at least 2 major calorie burning "events" every day. In the summer it's a lot easier and sometimes I can do 4. I ride the exercise bike every morning for 40 minutes. Simple HIIT program. I can do it with my laptop in front of me so I can "work" if someone needs something desperately during those 40 minutes. I also try to go to the gym and get a lift in. I can comfortably do this 5 days a week. If I can't make the gym I try to take a 30ish minute walk. If you can't make time for stuff like this, walk places, park further away, count steps, etc.
Mindset. I found that when I approached things from the mental side of it rather than the physical it was a lot easier. Weight loss/transforming your health is not a physical issue at the end of the day, it's a psychological one in my opinion. The work isn't that hard, it's convincing your brain to do the work (and keep doing it) that is the ultimate trick. Life is hard, there are a ton of obstacles affecting our brains every single day. Even something as simple as your kid having a hard time in school might throw your brain off and make you not want to do the work.
I am not hear to argue with anyone and the above is not a definitive guide for anyone, but like I said, it helped me.