failed glucose, and weight loss

Hallie • Had an ectopic in November 2015. Baby boy born March 14 2017 & Baby girl born March 19 2020.
Got an ultrasound today at 28 weeks, baby is 2lbs and 15oz. He is no longer breech but is transversal (sideways). I was told I failed my one hour glucose so I have to take the three hour next. My doctors also told me I need to get some weight off. What is the best way to lose weight while pregnant? I'm gonna start walking on the treadmill, and being cautious of what I eat. I don't know what else is safe to do. Any advice would be appreciated.