Dear Sir,
Are you married, If no, your questions is not valid to discuss.
If you are married, Then,
This is also called performance anxiety or anxiety about sexual intercourse.
Your mind is thinking about the past failure on sexual intercourse which makes you not to focus on present performance. ( mind wanders and automatically your reaction get fallen).
There is chance that you have loss interest on your wife or depression because of any cause or disease.
Next Steps
1.Check whether you have period of normal function before?
2. Does your erection occurs during foreplay?
3. Does your erection occurs on waking in the morning or in response to masturbation?
4. Do you drink or use any drugs?
5. Do you take any medication?
Try Routine blood test with blood flow using Ultrasound.
Health Tips
1. Feel positive and enjoy sex.
2. You can also visualize your favorite women but don't convey this to your partner.
3. Eat more dry fruits and go from walk.
If need aries pls consultant psychologist or Gynecologist or urologist for further assistance.