Thanks for your query.Based on the facts that you have posted it appears that you have severe pain
on retracting your foreskin and your glans penis
is also red and inflamed.
This is most likely to be due to infection of the glans and foreskin.
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.
If problem persists even after taking antibiotics consult qualified General surgeon
for clinical evaluation to rule out Phimosis If positive you may need to get circumcised under local anaesthesia.