This is Dr. David
this can be due to infection or irritation of the foreskin.
best to wash the area as well as you can with a mild soap like Dove and water
you can use neosporin on the area
and avoid sexual activity until the area calms down
some people need a course of antibiotics to help treat a swollen foreskin.
if the area is so swollen, it affects your urination, you need to see a doctor right away at the A&E or hospital.
let me know if you have other questions.