TMP-SMX is contraindicated in children with known hypersensitivity to trimethoprim, sulfamethoxazole, or other sulfonamide drugs. It is also not recommended for infants under two months of age due to the risk of kernicterus, a type of brain damage that can occur in newborns with severe jaundice. Children with certain conditions like severe liver or kidney disease should use this medication with caution.