If you have the conditions, you can go to the dental hospital emergency treatment, if not, you can change the position, temporarily take painkillers, anti-inflammatory drugs and so on.
The toothache at night is mostly acute pulpitis, manifested as night pain, spontaneous pain, radiating pain. If you have the conditions, you can go to the dental hospital emergency treatment, open the pulp drainage, release the pressure in the pulp cavity, you can stop the pain.
If you are unable to go to the hospital in time, you can first try to change your position to reduce the pressure in the pulp cavity and see if the pain is relieved. Another thing is to temporarily take painkillers and anti-inflammatory medications such as ibuprofen and amoxicillin. The medication should be used according to the instructions. Promptly go to the regular hospital on the next day and give targeted treatment or therapy under the guidance of the doctor.