Too much weight gain?

I went to my regular ob appointment At 24 weeks and I have gained 14lbs so far this pregnancy, I was overweight to begin with. My doctor told me to watch what I was eating and to be careful with the weight gain, I’ve tried everything and I can’t seem to stop gaining weight. Has anyone else went through this? How did you stop gaining weight?