If you want to lose weight long term, you need to change your eating and exercising habits permanently. Extremely restrictive diets are only ever going to be short term things and then when the target weight is reached, you go back to your old eating habits and putting weight back on.
It's really as simple as balancing the calories going in with the calories going out. Whenever there's an excess going in, you're going to store that in fat, and vice-versa.
Also be careful with the exercises you pick if you're obese (not saying you are, @OP, just talking in general). Taking up jogging or hiking might not be the best idea for your knees and hips. Swimming, on the other hand, would be perfect.