There are very good solution now a days for your problems.
Many a times these occur due to psychological reasons.
Beside that any chronic disease like diabetes
etc may be responsible.
some medications can have an impact on erectile dysfunction
so avoid self medication
if is a practice.
Bike riding probably is not the cause.
Avoid tight underwear..
Try to be tension free.
To find out the actual cause it needs a complete mental and physical check up.
Now a days many drugs are available to treat it.
Consult a general physician/sexual health practitioner.