Struggling

My husband and I have been trying for over a year to get pregnant. After several doctors visits and never getting a positive pregnancy test, my doctor pretty much told me I'm too fat to get pregnant. I'm 5' 7 and about 245 pounds. Yes I know I'm fat, but I have family members who are 350+ pounds and they are both pregnant at the moment! I try so hard but I want to start healthy eating and have a good healthy diet so I have more energy to go work out. Does anyone have any advice on what I could eat or make or do to change my diet that will help me? I'm trying to lose 35-40 pounds! I'm just feeling very discouraged and fat lately. Thank you in advance!