This is called performance anxiety. Several situations can cause it. For example, the anxiety caused by having to do intercourse on so and so days for conception.
Next Steps
You would need a few tests, counseling, reassurance and some techniques. Would you be able to consult in person or by phone? Or consult a sex counselor near you.