Typically, pain in the glans
of the penis, especially the corona (the area you describe) is attributed to a handful
of minor things that are easily fixed. Overdoing it on the self-lovin' or a lot of sex without enough lubrication can cause pain, so if you've been doing either or one of those, use actual lube. Silicone-based lubes are, imo, the best, and you can find a few at drugstores like Walgreens anymore.