My husband has hypothyroidism

I’ve heard if left untreated it can cause infertility, but when treated the levels, sperm count and motility go back to normal. My husband is 26 and has been having a hard time keeping an erection. He’s been on a med for his hypothyroidism since high school. Can this cause infertility for us? Feeling worried and down 😞