A 56-year-old man with alcohol-related cirrhosis presents with profuse vomiting of blood. He is agitated, intermittently drowsy and repeatedly coughing while blood fills his mouth; oxygen saturation is 91% despite high-flow oxygen. His blood pressure is 94/60 mmHg, and urgent endoscopy is being prepared. Which one of the following should be undertaken first?