As you are saying you have a cavity problem already and now that it has started paining, I would suggest you to kindly visit a dentist as soon as possible as if the caries have involved the pulp (ie. the nerves) and eventually form abscess (pus) in the bone what we call as the periapical region of the roots of the tooth, then you are likely to face more pain and discomfort. Moreover earlier the treatment is started its always better. Not to forget about the plaque and calculus, please get your teeth professionally cleaned to avoid gum diseases.
Next Steps
Visit a dentist and get the treatment