Depends on age
Hearing screening done in the newborn period (called algo) is done by putting headphones on the baby and testing while the baby is calm or sleeping.
This testing is quite easy. After 12 months of age, a baby who needs hearing tested can have behavioral audiology. In between, baby is too young to respond adequately so hearing testing must be done via brain stem responses, requiring sedation.