Gregory Rodriguez thought he had the flu when he went to the emergency room on Sept. 18 , feeling feverish, nauseated and short of breath.

He woke up four days later in a different hospital, with a tube down his throat connecting him to a ventilator, and two more tubes in his neck and groin, running his blood through a device that pumped in oxygen and took out carbon dioxide. The machines were doing the job of his lungs, which had stopped working.

“I was basically on the verge of death,” he said.

Mr. Rodriguez, 22, a college student, is one of the nearly 1,300 people in the United States who have become seriously ill because of vaping. Like him, about 70 percent are young men. And also like him, many vaped THC, the psychoactive ingredient in marijuana.

Vaping is odorless and easy to hide, and Mr. Rodriguez slipped into doing it constantly, inhaling enormous amounts of THC and craving more. He decided to talk about it in the hope that his story might be a warning to other people under the false impression that vaping is safe.