Yes, I would say diet is a major factor in weight maintenance/loss. If you are able, I'd suggest tracking your daily calories and eating foods that make you feel full so you aren't as hungry later. For me, that's typically protein/fat like chicken, turkey, eggs, even pork and steak. I can also do milk, but I know not everyone can do dairy. I'm also one of those odd people who actually eats mustard greens, spinach, and broccoli.
If you are blessed enough to go out to eat/order out, they have low-calorie options sometimes. Applebee's has a ~$13 portabello steak with grains, spinach, and cherry tomatoes for 340 calories.
You can treat yourself once in a while, but you'd have to take the calories away from somewhere else. I'd suggest mixing up the diet with healthier things you like and eating before shopping to help keep away from things that'll get you in trouble.
If you do exercising, do gentler stuff like stretching or modified push-ups, ~30 seconds at time, with considerable rest thereafter - like the Workwell Foundation suggests. Start slow. And take it easy on yourself.
You can start tracking roughly how many calories you'd burn per day. For me, walking around the house ~1,200 steps/day on average and doing some small stuff might put me at 1,880 calories.
You may have to give up something else to exercise. It depends on how important it is to you.