You lose weight in the kitchen, you get fit in the gym.
In other words, it's easier to NOT eat that candy bar than it is to walk the 4 miles you need to burn it off. Eat less calories that you burn and you will lose weight.
Here's a keto calculator usually used for those who want to do a keto diet, but you can also use it just to help you figure out how many calories you need to eat:
https://www.healthyweightforum.org/eng/calculators/keto/
As for exercising, don't spend money buying weights and gym memberships. Go on YouTube and look for body weight exercises to start with. I recommend this hybrid calisthenics, he has a free routine: