Your underwear itself won’t necessarily cause a yeast infection, but there are a couple of factors that may contribute to promoting an infection. First, make sure you’re wearing underwear – whether a thong or panties – that is clean and that has been laundered with detergents that aren’t too harsh. Your best bet is to choose breathable fabrics, like cotton, that will allow air flow (and, thus, a dryer environment).
If you have a yeast infection, you should probably avoid wearing thongs or g-string underwear for a while. It’s not really conducive to treatments (or using suppository treatments). This type of underwear also tends to be tighter than traditional panties, which will contribute to harboring moisture.