That's a question for your GP not a bunch of unqualified strangers on the Internet.
In general terms certain medications can affect your ability to get hard but your Doc is the best person to discuss it with - could be any number of other reasons.
There are so many reasons, book an appointments with your GP or go and spreak to a pharmacist. There are also several products you can buy over the counter to help.