You are 21 and if you feel sudden loss of hardness it suggests may be you are not helping the maintenance of erection by an active participation in sex. While having sex you can imagine that athe same sex is happening in exotic setting , change of scene, partner, etc and this can let the hardness go on.
Erections happen due to increased blood flow to penis as signalled by brain at arousal. if the penis loses its hardness it could be sign of leakage of the blood that had accumulated in penis
So you can do a doppler study of penis to find out if there is any venous Leak.
Next Steps
For increasing desire you musta ctively think of sex many times a day and indulge in some fantasy play to help your body rekindle the pleasure of getting aroused at various times of the day.
Health Tips
You may consult a urologist to find out if there is any
testosterone deficiency or a venous leak that is making the penis less hard at erection