There is no diet pill that works.
You just have to eat properly and exercise, as has always been the answer.
Your under-eating might actually cause you to gain weight, because your body might be retaining all the calories from what you eat. If you don't eat enough, your body goes into emergency mode. Try eating smaller amounts more often, and be sure to eat breakfast.