If you would have filled the cavity soon when it came off you wouldn't have experienced these complications
Now that you already have pain while chewing or due to food lodgement... I would advise you to visit a dentist and get a x-ray done.
X-ray will give a better picture for the dentist to understand and suggest you accordingly
If the cavity has reached pulp root canal treatment is the option.
Next Steps
visit your dentist asap
donot delay
Health Tips
keep the area clean.
use cold pack for temporary relief from pain