The first thing to do is take a deep cleansing breath and slowly let it out. Do this several times for it will clear your brain and enable you to be more in control of your thoughts, so you can think and act with more clarity. Pain can be very controlling and the object is for you to take control of it.
The second thing to do is to try to find where the pain is coming from. Does heat or cold relieve it. Hold a mouthful of very warm water on the affected area. If you feel relief (it may be worse initially) continue with these warm soaks, doing a cupful every hour or even every 15 minutes in acute situations. (Hold the water until the warmth leaves, then take another mouthful.)
You can support the effect of these mouth soaks by holding a hot water bottle or compress on the face adjacent to the painful area. Hold the heat no longer than 10 minutes at a time to prevent over dilation.
Conversely if cold feels better (this usually works as an immediate response to trauma or accident.) Keep cold on 10 minutes and off 10 minutes for 30 minutes out of an hour.
There is an accupressure point (known as the Hokupoint) located in the web between the thumb and index fingers. Rubbing an ice cube in the web (on the same side as the dental pain) can stop the painful experience. Do this until pain subsides. Rest for 10 minutes than repeat with an ice cube for another 10 minutes.