context: When it comes to headache remedies, medications can ease your pain, but they aren't the only option. Changing your lifestyle to control stress or avoid triggers may work well, too. These tactics may even prevent you from getting headaches. What works for one person may not work for another, so talk to your doctor to figure out the best remedy for you. Different types of medicine treat different types of headaches. Tension headaches: Pain relievers like acetaminophen, aspirin, ibuprofen, or naproxen usually help. But be careful. Taking too many of these pills can cause hard-to-treat rebound headaches. If you need to take these drugs often, see your doctor. Don't give aspirin to anyone under age 19 -- it raises their chance of having a serious condition called Reye's syndrome. Migraine headaches : One class of drug, called triptans, is the mainstay of migraine treatment. They include eletriptan ( Relpax), naratriptan ( Amerge), rizatriptan ( Maxalt), sumatriptan ( Imitrex), zolmitriptan ( Zomig), and others. You can take them as pills, shots, or nasal spray. A form of ergotamine, called dihydroergotamine ( DHE), also treats migraine headaches. You can get it as a shot or as a nasal spray. Aspirin and other nonsteroidal anti-inflammatory drugs ( NSAIDs) also can help if you take them at the first sign of a migraine attack. NSAIDs also include ibuprofen and naproxen. If you have four or more severe, prolonged migraine headache days each month, your doctor may suggest you try medicine and other things to prevent your attacks. These could include: Blood pressure drugs like propranolol ( Inderal), verapamil ( Calan SR, Isoptin SR), and others Antidepressants Anti-seizure drugs like topiramate ( Topamax) Calcitonin gene-related peptide ( CGRP) inhibitors like erenumab ( Aimovig), galcanezumab-gnlm ( Emgality),and fremanezumab ( Ajovy) Muscle relaxants Relaxation and biofeedback techniques Avoiding foods that trigger your migraines Devices to prevent migraines include: Cefaly: This small headband device sends electrical pulses through your forehead to stimulate a nerve linked with migraines Spring TMS or e Neura s TMS: This device gives off a magnetic pulse that stimulates part of your brain. You hold it against the back of your head at the first sign of a headache. gamma Core: This hand-held portable device is also known as a noninvasive vagus nerve stimulator (n VS). When you place it over the vagus nerve in your neck, it sends a mild electrical stimulation to the nerve's fibers to relieve pain. Cluster headaches : Simple pain relievers do little for these, because they don't work fast enough. But doctors have found that inhaling high doses of pure oxygen can bring relief. Pain medicine such as lidocaine that goes inside the nose helps some people. Triptans such as ergotamine or sumatriptan ( Imitrex), given as shots, also might help if you take them at the first sign of a cluster headache. Preventive medicines often work when you take them at the first sign of a new cluster of headaches. Choices include the blood pressure medicine verapamil or a short course of a steroid like prednisone. Sinus headaches: Decongestants and antibiotics usually help if you have a bacterial infection. If you know the things that trigger your headaches -- such as certain foods, caffeine, alcohol, or noise -- try to avoid them. To learn more about what brings on your attacks, keep a headache diary that includes answers to these questions: When did your headaches first start? How often do you have them? Do you have any symptoms before the headache starts? Where is the pain? How long does it last? At what time of day do the headaches happen? Do you seem to get them after you eat certain types of food? For women, at what time in your monthly cycle do they happen? Are the headaches triggered by something in your environment, such as smells, noise, or some kinds of weather? How would you describe the pain: throbbing, stabbing, blinding, or piercing, for example? When a headache hits, try these simple things to help yourself feel better: Use an ice pack on your forehead, scalp, or neck. Take OTC meds like acetaminophen, ibuprofen, or naproxen. Get some caffeine. Go to a dark, quiet room. Other treatments can bring you relief or even prevent attacks. Chiropractic and osteopathy. When muscle strain causes tension headaches, a chiropractor may be able to ease it with spinal or cervical manipulation and realignment. Osteopaths also can use manipulation and soft tissue techniques on the head, neck, and upper back. Biofeedback and relaxation. Biofeedback helps you control how muscle groups react to stress. This may help prevent or relieve tension headaches. Acupuncture. Studies have shown that this practice of placing thin needles at specific points on the body may help relieve tension and migraine headaches. Mind-body medicine. Hypnosis, deep breathing, visualization, meditation, and yoga may relieve pain by helping you deal with stress. It may be especially helpful for tension headaches. Hypnosis also may lower your perception of pain. Cognitive behavioral therapy. CBT mixes meditation and relaxation with education in motivation, behavior, and how to handle emotions. With the help of a psychotherapist, you can learn to change negative thoughts and attitudes and the way you respond to stress. Those skills may help you avoid tension-type and migraine headaches. Botulinum toxin. Best known as Botox, a treatment for wrinkles, the FDA has approved it to prevent chronic migraine headaches in adults. If you have a migraine 15 or more days per month, you can get Botox shots in your head and neck about every 3 months.