Hello
I share your concern, i will try to help you out in best possible way.
Looking at your description this could be STI or infected ulcer may be due to trauma during
masturbation or an
allergic reaction.
Another possibility is
prostate problem or a Renal stone
I would like further information help you better
relevant medical history like metabolic disease or
hormonal disorder
Any recent exposure to unprotected sex?
You should ask your doctor for few investigations to confirm the diagnosis like Urine culture and sensitivity test and an
ultrasound to see for prostate enlargement
Blood for CBC and liver function test or urine test are advisable if it is a chronic issue
Maintain good hygiene
Wash and clean it with antiseptic solution or soap
You can apply antiseptic ointment externally.
Use condom during sex if you are sexually active
Hope this answers your question please feel free to ask for more clarification
Thanks and regards