Yeast infections are not directly caused by your dog's food, so a food change might not be needed. In general, complete and balanced nutrition is recommended. For dogs with a possible underlying cause of food allergies, your veterinarian may recommend a therapeutic derm food that supports skin health and limits potential allergens.
For dogs prone to skin issues, feeding high-quality nutrition rich in essential fatty acids (like omega-3s and omega-6s) can help support a healthy skin barrier.