Hello,I would suggest that you get your eyes checked to rule out any refractive error
[visual defect] as the cause of headache,if not it can be commonly due to tension headache
for which you can take tablet paracetamol
500mg whenever in case of pain and also do some relaxation exercises like yoga.
It can also be due to migraine
if the attack is preceeded by an aura i.e.seeing of lights ,vomitting etc,for which there is a prolonged treatment