I assume that you had a vaginal yeast infection (also known as a candidal infection, Candida being the scientific name for the yeast that causes this kind of infection). Vaginal yeast infections are extremely common in women, most of whom are otherwise completely healthy.
The yeast that cause the infection actually live in the vagina all the time, but occasionally they proliferate out of control, leading to the symptoms. Usually, this happens when you have just taken antibiotics for some other condition, as the antibiotics kill off the bacteria in the vagina that normally keep the yeast in check.
Although there is some thought that eating certain foods, especially yogurt, may help to protect against yeast infections, this hasn't been born out very well in scientific studies. Although eating yogurt will certainly not hurt, there is no guarantee that it will help prevent future infections either.
There are a few things you can do to prevent yeast infections however. In particular, avoiding anything that disrupts the normal chemical balance in the vagina can help - this mean no douching or other vaginal cleansers!
Talk to your primary care doctor
or your OB GYN doctor about this issue. They can give you a full diagnosis and treatment. Good luck.