Even though you were last sexually active four months ago it's very possible you may be infected with an std. Sometimes it may take days, weeks, or months before you start to notice symptoms. And even then, some stds may not cause any symptoms at all such as chlamydia or gonorrhea those or the 2 silent infections. NOT to worry just go and get tested asap to ease your mind. Burning sensations are never sound good.
Hi, 4 months is a good time to rule out any std,s and since the irritation is at the tip, maybe you caused it when masturbating causing a slight rip at the tip. Also if you use lubs or creams it may have gotten inside and is causing the burning. If your concerned have a doc check you out.