If a cavity causes a headache, it means that the cavity has developed into pulpitis, and the typical symptom of pulpitis is severe spontaneous pain in the tooth, this pain will be involved, radioactive pain, and the pain will lead to severe pain in half of the head, in this case, you should seek medical attention in time, go to the hospital to do root canal treatment on the affected tooth, first of all, under local anesthesia to inactivate and remove the infected pulp, after this treatment step After this treatment, the pain will be greatly relieved or even disappear. In the acute pain period of pulpitis, patients can also take their own painkillers at home to relieve the pain, you can take oral ibuprofen or metronidazole to relieve the pain, you can also use local cold compresses to relieve the pain, the specific method is to use medical ice bags or chilled bottled mineral water, cold compresses on the corresponding side of the cheek for about 20 minutes to relieve the pain.