Hi there ~
After having read your concerns, it seems to me that you are having a urinary tract infection
. Please see a venereologist and a urologist
to rule out UTIs/STDs and prostatic problems respectively. Difficulty maintaining erection during sex indicates that you have erectile dysfunction
which can be treated by psychiatric medications after seeing a psychiatrist
who would take a good history and performs a good physical examination and investigations. I hope this helps.
Take care and have a lovely day!