How can I lose weight and gain muscle?


I am a sophomore in high school and always dealt with a LARGE legs. Right now, I’m 140 pounds and 5’6”. My goal is 120-125 pounds and I don’t know how to lose it. I’ve asked the doctor, then the Internet, and so on and they all gave the same answer of “Just eat healthy and exercise.” No further information and I was left in the dark. I have been eating healthier, trying to drink more water, and doing exercises. IT HAS NOT HELPED. If anything, I’m gaining weight. What’s wrong? How can I lose the weight and gain the muscle?