Thanks for your query,based on the facts that you have posted it appears that you have infection of glans penis
called as Ballanitis.
You need to take broad spectrum antibiotics like Cefotaxime
along with anti inflammatory medication like Diclofenac
twice daily and topical antibiotic
ointment like Neosporin twice daily.
Ensure to wash your genitals with warm water twice daily before you apply ointment.
This should heal up within a week.