Late one Saturday night Tim was really hungry and decided to go downstairs for a snack. He found some cake with caramel icing on the kitchen counter, and gobbled it down. Then he climbed back up to his room and crawled into bed.

Then, just as he was drifting off to sleep, he remembered what his dentist had told him that morning during his checkup. He thought about how little germs in his mouth were busy making acid out of the little bits of cake stuck to his teeth. Yuck! He didn't like to think about that acid being made in his mouth. So he crawled out of bed again and brushed his teeth. "Take that, bacteria!" he thought.

Tim did the right thing when he brushed his teeth that night. By removing small bits of food, he robbed the hungry bacteria in his mouth of a meal -- and prevented them from damaging his teeth.

All of us have bacteria living in our mouths. They're too small to be seen without a microscope. But they're not too small to cause trouble. When bacteria eat certain foods, especially sugary things, they produce acid. When the acid meets the surface of your teeth, it can eat away their white enamel surface.

If Tim hadn't brushed after eating that piece of cake, his teeth would probably have felt kind of mossy when he woke up the next morning. A substance called plaque would have formed on them during the night. Plaque is a mixture of food, saliva and bacteria. If plaque stays on your teeth too long, it hardens into a yellow substance called tartar.

Your dentist will tell you that plaque and tartar have a lot to do with the development of cavities. This may be because the acids produced from the food you eat stick to the plaque and tartar, and stay on your teeth longer. The longer the acids stay, the more chance they have to dissolve holes in the enamel on your teeth.

The enamel coating on your teeth is the hardest substance in your body -- even harder than your bones. This outer coating protects the rest of each tooth: the hard, bone-like layer of dentin below the enamel; the blood- and nerve-filled pulp at the tooth's center; and the long root, which anchors the tooth firmly in the jaw.

Enamel is tough. But once it's damaged, it can't repair itself. When you get a scratch on your hand, the skin quickly heals. But when the enamel coating on a tooth gets a hole in it, the hole stays there. And as you probably already know, another word for hole is cavity. Once the hole is there, infection can spread into your tooth, causing it to decay.

If you do get a cavity, your dentist will probably use a high-speed drill to remove the decayed part of your tooth. Then you'll get a filling made of a mixture of metals or plastic, or even gold. Most kids don't have cavities large enough to need gold fillings. But most kids do get cavities. By the time children in the United States reach the age of 12, 90 percent of them have developed some cavities.

Dentists are good at filling cavities -- but they'd rather not have to do it at all. They'd rather prevent cavities before they start.

The water you drink probably contains small amounts of chemicals called fluorides. Many scientists believe that fluorides help prevent tooth decay. The chemicals make the enamel on the teeth harder and more resistant to acids. You may also use a toothpaste or mouthwash that contains fluoride. Your dentist may be giving you fluoride treatments when you go in for your check-up, too.

The American Dental Association supports the use of fluorides. In 1984, they decided to recommend the use of sealants, too. Sealants are made of liquid plastic. Your dentist applies them to the teeth, where they harden and form a protective barrier.

Research has shown that sealants are very good at keeping bacteria away from the enamel on your teeth. They're especially useful on the biting and chewing surfaces of your back teeth, where decay happens most often. Those areas are pitted and grooved, as you can feel if you run your tongue across them. The pits and grooves help you grind up your food. But they're also hard to clean with a toothbrush, and make great hiding places for bacteria. Sealants can help keep the germs out.

Sealants are one more weapon in the war against tooth decay. According to the American Dental Association, you should also use fluoride, get regular dental check-ups, brush and floss your teeth every day, and limit the number of sugary foods you eat. Tips for Parents

Do you have trouble getting your kids to the dentist? You may be part of the problem. If you experience dental anxiety, you may communicate it to your children -- especially if you stay in the room with them as they're examined, according to Dr. Monica Cipes of the University of Connecticut Health Center.

Cipes, who is studying dental anxiety in children, hopes to show that "playing dentist" with stuffed animals and realistic but safe dental tools can help desensitize children to actual treatment. Similar practices are very successful with helping children prepare for medical procedures, including major surgery.

Another study, this one from the West Virginia School of Dentistry, provides a practical suggestion: Let your child listen to stories on a Walkman during dental visits. You probably should check with your child's dentist first. Researchers report that "uncooperative behavior" in kids aged 4 to 9 dropped by 80 percent when they listened to fairy tales and other favorite stories during treatment. Maybe you can find one about the tooth fairy.