On March 30, after four days of rebuffs from his superiors, Captain Crozier sat down to compose an email. “Sailors don’t need to die,” he wrote to 20 other people, all Navy personnel in the Pacific, asking for help. A Naval Academy graduate with nearly 30 years of military service, the captain knew the email would most likely end his career, his friends said in interviews. The military prizes its chain of command, and the appropriate course would have been for the captain to continue to push his superiors for action.

He hit “send” anyway.

Three weeks later, the fired captain is battling the coronavirus himself, 584 other crew members have tested positive and the acting Navy secretary has resigned. The secretary, Thomas B. Modly, removed the captain because he thought that was what President Trump wanted, officials said. Mr. Modly, the officials said, was keenly aware that his predecessor in the job had been fired after tangling with Mr. Trump. But in trying to please the president, Mr. Modly miscalculated and destroyed his own career.

The story of the Theodore Roosevelt encapsulates, aboard a single aircraft carrier, Mr. Trump’s tumultuous three and a half years as commander in chief. The episode shows how the military, the most structured and hierarchical part of the government, has tried to adjust to an erratic president, and how in a hollowed-out leadership, acting secretaries have replaced those confirmed by the Senate.