Hi, Welcome to Health care magic forum.
Your decision of reducing the weight is right, but only depending on the gym may not be sufficient , and may recur after stopping.
You can keep weight under control, by avoiding fats,fries, junk foods, and oily foods.
Increase your activity by practicing, morning walk,
yoga, gardening, and do any work in front of you.
Minimize the sleeping time ,practice late to bed, and early to rise, avoid day time sleep.
Wishing for a quick and complete recovery. Thank you.