How to stop the pain quickly when a tooth has a hole and the nerve is hurting?

The nerve of a tooth with a rotten hole is particularly painful, which is caused by dental caries or pulpitis, and it is recommended to seek medical treatment to repair the tooth defect or root canal treatment in order to quickly stop the pain.
1. Rotten tooth cavity (clinically known as caries) will lead to tooth surface hard tissue defects, so that the nerve is susceptible to external stimuli such as hot, cold, sour and sweet pain; need to carry out caries filling treatment, that is, the caries part of the clean, followed by dental restorative materials, such as glass ionomer, resin on the defective parts of the restoration in order to quickly stop the pain.
2. If the tooth is decayed to the nerve, it will lead to the infection and inflammation of the nerve and the symptoms of pulpitis, i.e. hot and cold pain, spontaneous pain and night pain, etc.; root canal treatment, i.e., extraction of the nerve, is required to clean the necrotic and inflamed nerve for quick pain relief.
In addition, if the relevant treatment cannot be carried out in time, painkillers (e.g. ibuprofen) or anti-inflammatory drugs (e.g. amoxicillin, metronidazole, etc.) can be taken under the guidance of a doctor to relieve pain.