How do doctors know if they should resuscitate a baby with birth defects?

Resuscitation. If it is know that the infant is going to have a lethal birth defect often prenatal counseling is done with the parents to determine if they want agressive treatment or comfort care for the newborn. If it is not know until delivery that the infant has a birth defect doctors usually resuscitate the infant and then do further testing to see if the defect is compatible with life.
Depends on what kind. "birth defects" can mean something very minor, like a small hernia, or an extra finger, or something that we know will cause a baby to die, like anencephaly. Doctors look at research about the outcomes of babies with certain birth defects, and talk to the parents about what the likelihood of survival is before making the decision whether or not to resuscitate a baby.