Why can't I stay hard during intercourse or sometimes not get hard even during foreplay?

See answer . It is more the rule than the exception for every man to experience variation in the quality of one's erections from time to time. Assuming you are a healthy 23 y/o with no medical issues and/or not taking or using any medications, recreational drugs, or tobacco that can affect erections, most ed is a result of psychological issues: stress, fatigue, anxiety, relationship problems, etc.