Thanks for your query,based on the facts that you have posted it appears that you have developed infection of the glans penis
(Ballanitis) resulting into excessive secretion of urethral glands and producing smegma.
You need to take broad spectrum antibiotic like Cefexine along with anti inflammatory drug like Diclofenac
twice daily.along with topical antibiotic
ointment like Neosporin
Ensure to wash your genitals with warm water twice daily.