It's due to cavity which was present between your teeth which you couldn't notice, most probably exposing your pulp,
Next Steps
Take keterol dt for now and take an appointment with a root canal specialist right over early in the morning
Health Tips
For now try putting Colgate pain out gel for temporary relief of 4 to 6 hours then repeat again till morning, don't delay with the treatment coz it might turn into abscess