I find i get headaches from overtightening my helmet, from hot weather and not drinking enough, One other possible thing to consider is your head is heavy so it does put stress on your neck and shoulders, which can migrate to a headache.
Suggestions, don’t over tighten the helmet if you have a tightening band on it (i am not talking about the chin strap but rather the cradle that on some helmets allows the fit to be customised)
How well ventilated is your helmet, more vents does make sense even if it isn’t fashionable.
Drink, but do not over drink, over drinking is far far worse than being a bit dehydrated!!!
As for neck ache, a mix of check position and ride more to strengthen the muscles.