Hi there. Inability to achieve erection ie erectile dysfunction could be due to many reasons like blood vessel blockage(vascular diseases), nerve injury, alcohol, smoking, stress and fear of inability to achieve proper erection, insufficient sleep, distraction because of some worry, anxiety, depression or, relationship problems,certain medications,
diabetes, hypertension.Treatment includes sex therapy for both partners, relaxation exercises, be confident and less worried, increase foreplay by which you may get more aroused, avoid alcohol smoking, get treated if you have any medical disease. Medications like sildanefil, tadalafil, vardenafil.don't use too much of these drugs. To diagnose the cause you need to undergo detailed examination and evaluation which may a week atleast.. Hope this helps you.