If a Cavity has just started and hasn't progressed too far then you can use demic toothpaste which bonds to the teeth and helps to fill in and heal a cavity.
But if the cavity has gotten too bad then you need to see a dentist to fill the cavity in as there's no other way to fill in a bad tooth cavity.
After you use demic toothpaste to fix the cavity at home you should use coconut oil to oil pull with and the coconut oil and oil pulling will get rid of bacteria that causes gum disease and cavities.
You can also use Apple Cider Vinegar as a mouth wash which also kills bacteria in your mouth.