Don't know why for the past few months my erection is not what it used to be, always semi hard only

probably due to work stress but that can't be help..
Is it ok if I take pills like viagra or cialis to enhance it? or maybe half a pill? is it safe? any other recommendation from bros here?