Thanks for your query.Based on the facts that you have posted it appears that you have infection of the foreskin (Posthatitis).
Many a times it is a presenting symptom of diabetes
.Please get your blood sugar levels done to rule out diabetes.
Please consult qualified surgeon or urologist
for clinical examination and to confirm the diagnosis.
Please take broad spectrum antibiotics along with anti inflammatory medication like Diclofenac
twice daily .
Get the prescription of medicines from your family Physician.
Ensure to clean your genitals with warm water twice daily.