Hard losing weight with pcos?

I had to go to Walmart to get these 5 star rated pills in order to lose the weight I wanted to but it's frustrating because I was in the gym losing weight by appearance and the scale showed increase before I began taking diet pills. Surgery is in 3 weeks so I hope that helps