For your age, it is most likely to be migraine. You should introspect also that what are the triggers of severe headache eg prolonged fasting, loud sounds, lack of sleep. How ever if it’s troubling you then get a baseline MRI/CT done to rule out any pathology.
You can take plain analgesics if headache frequency is once or twice in a month
Next Steps
Adapt to healthy lifestyle
Health Tips
Avoid prolonged fasting, loud sharp music,
Sleep 8-10 hours