The end of my penis is really red and sore. Its typically hurts more after I have masturbated.
Your info is very sparse!
How much of your glans is affected?
When did you first notice it?
Are you uncircumcised?
How old are you?
Have you had unprotected sex?
Have you got a photo? - if so, click or tap on scenery icon at top right of reply box to upload.
Have you tried any creams?
From what you've said so far I would try an anti-fungal cream like Daktarin or Canesten first.
Is it
As Pepasan said, a pic would help. This should help you add images:
https://patient.uservoice.com/knowledgebase/articles/402861-how-do-i-add-an-image-to-my-post
If you're using a phone or tablet, you may need to choose the desktop/PC option in your browser.
It sounds like balanitis though.
These links may help:
https://patient.info/health/balanitis-leaflet
https://patient.info/doctor/balanitis-pro (written for doctors)
Washing every day (with water only) and taking a leak and washing after sex or masturbation will probably help, and you could also try Canesten cream.