If you have a cavity that is just beginning you should brush your teeth more often and gargle with Apple Cider Vinegar to help kill the bacteria in your mouth that can cause the cavities and gum disease.
You should also brush your teeth using demic toothpaste because demic toothpaste can naturally heal cavities since it sticks to the tooth.
If the cavity has gotten too bad though then you'll need a dentist to put in a filling to fill in the cavity.