Hi, you can consult a psychologist who will assess what is causing erectile dysfunction. There are physical and psychological conditions that can cause erectile dysfunction such as sleep disorders, tobacco use, alcoholism, stress, anxiety, depression. Do not worry too much a psychologist will identify what is causing erectile dysfunction and help and guide you with ways to manage stress and feel calm.
What you are going through will not affect your relationship. You can discuss with your partner so that she can understand you.
You can consult a doctor as well.
Next Steps
Consult a doctor and psychologist.