RecruitingDevice studyA Trial Comparing High-Flow Nasal Cannula Versus Noninvasive Ventilation on Reintubation and Post-Extubation Respiratory Failure in High-Risk Patients With Systolic Heart FailureThis prospective, open-label randomized controlled pilot trial will enroll participants at the Yale New Haven Hospital. Patients with systolic heart failure, defined as an ejection fraction ≤40%, who require invasive mechanical ventilation (IMV) and are admitted to either the cardiac intensive care unit (CICU) or medical ICU (MICU) will be included. Subjects meeting eligibility criteria will be randomized 1:1 to one of the two treatment groups: * Intervention: Extubation to high-flow nasal cannula (HFNC) * Control: Extubation to non-invasive ventilation (NIV)