Go through these in order and stop at the first one that applies. If you are reading this for someone else, answer for them.
Call emergency services or go to an emergency department if swelling affects breathing or swallowing, spreads toward the eye or neck, or causes severe difficulty opening your mouth.
These signs may indicate a spreading infection.
Do not wait for a suspected cavity to become painful, because early treatment may be simpler.
Seek prompt dental care for persistent toothache, pain that wakes you, swelling near a tooth, pus, a bad taste from the affected area, or difficulty opening your mouth.
Get urgent same-day medical or dental help if facial or jaw swelling is increasing, or if dental pain occurs with fever or feeling significantly unwell.
Arrange a routine dental appointment for tooth sensitivity, a visible spot or hole, food trapping, a rough tooth surface, or mild recurring pain.
Every sign above is quoted from the sofidex article on Dental cavities. If you are not sure, err upward — it is always reasonable to be checked.