Hello,
Psychological reasons are one of the important causes of erectile dysfunction. Talk to your partner openly and discuss the relationship issues. Lifestyle choices like excessive smoking, being overweight and avoiding exercise are other possible causes. In such cases quitting smoking, losing excessive weight, and increasing physical activity may help some men regain sexual function.
Other serious causes are neurogenic disorder (spinal cord and brain injuries), certain drugs like anti-depressants or nicotine cavernosal disorders, ageing, kidney failure, smoking, and psychological causes. Several laboratory tests can help to confirm diagnosis.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.
What is your age? Did you have any important event which made you flaccid? Usually this would settle given sometime. However you may googe male deer exercise, kegel exercise and sat kriya. this may help you to restore your system.