Hi sir....
it is not clear whether the corner teeth you mentioned is wisdom teeth(3 rd molar) or 2 nd molar..
pain usually indicates the cavity reaches nerve layer (pulp)
If it is 3 rd molar you need to go for x_ray(OPG) and extract(remove) the teeth followed by analgesics and antibiotics...
If it is 2 nd molar you need to go for RCT...
x_ray (IOPA) should be done to conform the extent of the cavity....
Next Steps
kindly visit nearby dentist for furthur consultation and management...
Health Tips
Avoid self medication....