Is it me?

So I'm feeling pretty insecure. My boyfriend and I had sex today... Well tried to.. We haven't had sex in like a month or so.. He was hard for a little bit then got soft and we couldn't get him back up. I always feel like its me because this has happened more than a couple times. He feels bad. I feel bad. Idk what to do. I want him to see a doctor about it but idk how to bring it up without making him feel more insecure or make him upset. I feel like he can't stay hard because I'm not attractive enough for him. Whether that me the case or not idk what to do any I'm pretty torn up about it.