Fasting is indeed a good way to lose weight.
When you're fasting your body uses your fat to give you energy and when you burn that fat off for energy while fasting then you lose that weight.
Fasting alone does help you lose weight but you should not fast too often as it could make you sick and cause you to faint.
However fasting at least once or twice per week is a good weigh to aid you in weight loss.
You should also watch your calorie intake and get plenty of exercise and eat foods low in calories.
For example eating a salad without any added meat or cheese is a good way to give you energy but also keep your calorie intake down.
The less calories you consume the more calories you should burn off and in turn you should lose the weight.