Welcome to e health forum.
For your information, some major causes of Erectile dysfunction, include conditions causing damage to nerves, arteries, smooth muscles, and fibrous tissues ; Lifestyle diseases like hypertension, diabetes, Smoking, being overweight and avoiding exercise are possible causes of ED.
Some tips for your help include:-
Cut down on smoking, alcohol, and illegal drugs.
losing excess weight,
Get plenty of rest and take time to relax.
Exercise and eat a healthy diet to maintain good circulation.
Talk openly to your partner about sex and your relationship. Seek your partners help for complete stimulation (Mutual masturbation , oral sex, etc can help in sexual arousal). Watching movies which promote sexual intimacy will also help. In case, you feel that she is not satisfied, then both of you can give each other honest and unbiased feedback and take positive steps, so that things start working again.
Good sex , need a prepared and relaxed brain. When in stress or when self doubt takes over, the confidence and hence the performance drops.
In case, you do are able to have early morning erections (while you are asleep), then it would be a indicator that you are completely normal and your erection issues could be psychological.
In case, there is lack of early morning erections, it would probably be due to low testosterone levels, or due to some form of penile injury.
In case there is confirmed ED, which is not treatable with medications (Viagra or Cialis), then surgical options including penile implants may be helpful.
Hence you might need to consult with your doctor or a urologist for a proper examination and treatment.
I hope this helps.