Patterns for babies need two things from your yarn: it must be soft enough to sit against newborn skin, and it must be machine-washable because babies make messes. Most yarn manufacturers label baby-suitable yarns clearly — look for cotton, bamboo, or superwash merino blends.
Preemie hats use very little yarn (about 30–50 yards) and make a generous donation gift for NICUs. Standard newborn hats are 12–14" head circumference; a 0–6m baby is 14–17".