Get a plastic bag and fill it with uncooked rice or corn and pop it in the microwave , then press it to your head. It relaxes it, although some people prefer icebags instead of hot. You could also try massaging the area where it hurts. Sleep is also said to stop headaches.
It depends on what causes the headache. I get headaches from dehydration, so I drink plenty of liquids, and use an ice pack. If it's from stress, or frustration, take deep breaths, and relax. Maybe take a pain killer if needed, but try to avoid medication when you can. Figure out what the cause is, and then work from there.