Fertility issues

I've had two miscarriages before and now I'm going to have surgery Tuesday because they think I have endometriosis. Not sure what to do. How many people have had endomitriosis and gotten pregnant later on? And how long did it take?