If the cause is emotional, therapy is likely necessary.
If the cause if medical, a doctor will need to be involved and he/she will recommend the appropriate treatment.
The best way to determine the difference between a medical ED vs. an emotional ED is for the man to use the "stamp test." It sounds silly, but it is doctor recommended and it works:
The man takes a roll of stamps, places it around the flacid penis just before bedtime (lick the ends of the stamp after encircling penis so that it sticks in place). In the morning, it the stamp ring is broken, the problem is most likely emotional.
Men will get at least one erection during their sleep if they are physically able. This is why the stamp test is an easy method of diagnosis. If the man does not get an erection and break the stamp circle, his problem may be medical and he should seek medical advice.