All at once, New York City seemed to be conspiring against Beto O’Rourke.

His girlfriend was moving to France. His punk bandmates had scattered. Twenty-three and searching — with an Ivy League degree that could not pay rent — Mr. O’Rourke subsisted as a live-in nanny on the Upper West Side, with a futon in the maid’s quarters, watching over a wealthy family’s two preschoolers.

[Update: Beto O’Rourke drops out of 2020 race.]

“I just remember his dad coming,” said the former girlfriend, Sasha Watson, recalling a pep talk from Pat O’Rourke, a prominent Texas county commissioner and judge, who insisted his son was destined for “bigger things.”

“He really saw great things for Beto.”

Great things were not happening. By late 1995, Mr. O’Rourke had fallen into the deepest depression he can remember. He worked for an uncle’s tech business because it was a job. He spent nights alone listening to his cassettes because it passed the time.

“Little bit of a sad case,” Mr. O’Rourke said.

More than two decades later, long after what friends describe as a quarter-life crisis, Mr. O’Rourke has arrived at a midlife crossroads of enormous consequence, with revealing parallels to his time in New York. Forty-six and searching — after a narrow Senate loss in Texas last year that propelled the former El Paso congressman to Democratic stardom — he has been driving around the country, alone, introducing himself to strangers, deciding if he wants to run for president.