I've always been on the heavier side, and have gone up and down in weight my adult life in the past ~20 years from roughly 220-280 fluctuating back and forth. I would get on a fitness or health kick and for one reason or another always fall back off the wagon. Luckily I've never had any major health issues from my weight. Well, I got an annual physical exam this October and when I stepped on the scale I was absolutely disgusted with myself. 304 pounds. I've never been anywhere close to that weight before. Like everyone else, I'm not getting any younger, and I don't want to be one of "those people" that you see on mobility scooters by 40 or dead of a heart attack before the age of 50.
It was embarrassing as hell, but I found a well regarded dietitian and weight loss specialist who I consulted with and has helped me out greatly. I've always known what foods are generally "healthy" but have learned alot about macro and micro nutrients, what combinations of food work well together, and what "healthy" foods you should avoid like the plague, or limit to small amounts. I downloaded an app and for the first time ever, I'm keeping track of everything I eat and drink (besides water) and it keeps tabs on my calories, vitamins, protein, fats, etc. I've cut out all added sugar, fast food, processed foods, most anything that has preservatives, and anything that is pretty much "prepackaged convenience store" junk. I haven't necessarily gone keto diet, but have cut back on carbs, generally switching out rice and potatoes for beans and other filling foods with more fiber, less starch and a better, lower glycemic index. I generally aim for less than 2000 calories a day, but everyone is different depending on their goals and body type.
I've also started going to the gym after work for light exercise over the past month, and while I've never been a fan of running, getting back into the routine of daily weightlifting makes me feel amazing and like I did during football season in high school! In less than 2 months, since November 10th I've gone from 304 pounds to 268 as of December 26th. Thats with no crash dieting or starvation, no bullshit water restriction or marathon sessions in the gym.
At the very least I would first off consult a trusted doctor about exercise regimens and what is safe for you to do, so you can avoid injuries that would make your situation worse. Then, find a legit dietitian or a good and experienced weight loss center in your area, they would be more helpful than Jimbob's cousin's uncle from down the street or assholes on the internet. I would also recommend a good meal tracker or calorie counter app that has real nutritional information on the foods that you eat, or you can scan the barcodes of food packaging and it automatically comes up, not just what you "think" the calories of something are, and then LOG EVERYTHING! From a cup of coffee to a full meal down to the seasoning, it is important to keep track of your complete daily food intake if you're serious about losing weight. Forget the concept of a "cheat meal" or "cheat day!" Choose better whenever you can! Obviously some foods should be avoided, but just about anything can be had in moderation, although I would start looking for healthier substitutes for the really bad foods. I know I keep bringing it up, but if you use a good app and actually see what you are eating, it helps you avoid shitty foods if you really care about making an improvement.
And I cannot stress enough how important it is to just get yourself up and moving around. Get your heartrate up, sweat a little, and enjoy things! Don't expect miracles in a day, and don't get discouraged if you skip a day of exercise or eating right, but don't make it a habit or use it as an excuse to give up. And don't let the assholes discourage you either. Its the internet, so no matter what they say, they're just as likely to be a basement dwelling incel as they are to be the literal reincarnation of 1984 Schwarzenegger.