Thanks for your query.Based on the facts that you have posted it appears that you have infection of glans
of your penis (Ballanitis).
Please take broad spectrum antibiotics along with anti inflammatory medication like Diclofenac
twice daily and tropical antibiotic ointment like Neosporin
Ensure to clean your genitals with warm water twice daily.It should heal up within a week.