Most probably ur tooth is badly decayed so u need to take some painkiller like Ibuprofen+paracetamol and go to see the dentist ,he will either extract the tooth or do the root canal therapy depending upon the situation.
Next Steps
Ger the X ray (IOPA) done to decide treatment.
Health Tips
Visit your dentist at the earliest and get the other cavities filled with dental cement.