Thanks for your query.Based on the facts that you have posted it appears that you have
developed infection of the glans penis
may be due to unprotected sex or vigorous masturbation
Please take broad spectrum antibiotics along with topical antibiotic
ointment like Neosporin
twice daily .
Get the prescription of medicines from your family Physician.
Ensure to clean your genitals with warm water twice daily.
Avoid sexual activities till it heals up completely.