The need for mechanical ventilation (MV) following acute respiratory and myocardial failure is the leading cause of admission to the pediatric intensive care unit (PICU). Over 90% of MV pediatric patients receive continuous sedation, most commonly with gamma-aminobutyric acid (GABA) agonist benzodiazepines. Recently, the investigators demonstrated that exposure to the benzodiazepine midazolam contributed to iatrogenic harm in pediatric patients-prolonging PICU length of stay and increasing the prevalence and duration of delirium. Delirium is prevalent in the PICU with rates of up to 30% in older children, over 50% in infants and toddlers, and up to 60-70% in those on MV. Delirium in children is a significant contributor to longer duration of MV, substantial consequential costs, prolonged ICU stay, and mortality. Adult studies have shown that an alternative sedation paradigm using dexmedetomidine, an alpha-2 agonist, decreases the prevalence and duration of delirium, duration of MV, ICU length of stay, cost, and infection rates compared to benzodiazepine-based sedation. Furthermore, the FDA recently published warnings regarding the possible role of anesthetics, including benzodiazepines, on cognitive dysfunction in children. Dexmedetomidine has unique anti-inflammatory and anti-oxidant characteristics that are appealing given the association between inflammation, and endothelial and blood-brain barrier (BBB) injury with prolonged delirium and worse cognitive impairment in adults. To this end, there has been no large pediatric cohort study to examine the relationship between sedative choice and exposure in the ICU (a much longer exposure) with cognitive impairment among pediatric survivors. The investigators, therefore, propose mini-MENDS (Maximizing Efficacy of Goal-Directed Sedation to Reduce Neurological Dysfunction in Mechanically Ventilated Infants and Children STUDY), in which the investigators will determine whether sedation of MV pediatric patients with an alpha-2 agonist (dexmedetomidine) versus a GABA-ergic benzodiazepine (midazolam) will decrease daily prevalence of delirium (Aim 1A) and duration of MV (Aim 1B), will be associated with better functional, psychiatric, and cognitive recovery (Aim 2), and reduced levels of pro-inflammatory cytokines and biomarkers of endothelial and blood brain barrier injury (Aim 3). To accomplish these aims, the investigators will randomize 372 pediatric patients on MV, aged 44 weeks post-menstrual age to 11 years, to receive goal-directed continuous sedation with either dexmedetomidine or midazolam for up to 10 days. Our primary outcome, daily prevalence of delirium, will be objectively measured by trained research nurses who are blinded to intervention arm. Screening for delirium will be completed using the Preschool or Pediatric Confusion Assessment Methods for the ICU (ps/pCAM-ICU), based on developmental age, twice daily for up to 14 days while in the PICU. Cognition, functional status, and parental/patient psychological health will be assessed at enrollment (baseline), hospital discharge (DC), and 6 months following ICU-DC during an in-person evaluation by the pediatric neuropsychiatry team. Blood will be collected on days 1, 3, and 5 post-randomization to measure cytokines, markers of endothelial and BBB injury, and for safety.