If you get a common illness, you should keep nursing. Your baby probably won’t catch what you have. In fact, before you even come down with the symptoms, your body has already produced antibodies in your milk, which will help protect your baby from what you have.
If you are sick enough to need medicine, ask your doctor what is safe for your baby. Most antibiotics and over-the-counter medication can be taken while breastfeeding. If you have a serious illness, talk to your doctor about nursing.
Source: “Why Should I Nurse My Baby? & Other Questions About Breastfeeding” Pamela K. Wiggins, IBCLC & Joanna Wiggins Garofalo.