silly question , yogurt and yeast infection

this is a stupid question but I have heard some say to eat lots of yogurt to get rid of a yeast infection and then I heard some people put it directly on their vagina to get rid of it - which one is correct?