Yeast rash

Took my 1 week old baby to the doctor today and she says she has a little yeast rash and told me what over the counter meds to get. But I feel absolutely horrible about it 😞 is this a common thing? How can I prevent it in the future?? I’m a first time mom so I’m new to all these things.