A headache happens when the muscles in the scalp tense. That is usually an unconscious habit, and now that you are conscious of it you can stop doing it. Magnesium pills might help, and maybe B vitamins. But mostly you just need to unlearn that habit.