Often times the pain from a tooth comes from decay in the tooth that allows the nerve to be exposed to sugar, heat, or cold. The only way to get rid of the pain is to stop the exposure. You can do this temporarily with a dental putty you can buy at the drug store. You will need to see a dentist to fix the problem for good. If the pain is from an abscess in or around the tooth, you may need antibiotics from the dentist to clear that up.