“In all too many cases, I had the sense that if only the immigrant had competent counsel at the very outset of immigration proceedings” Judge Katzmann said during a speech in 2012, “the outcome might have been different, the noncitizen might have prevailed.”

The judge formed a study group that found that immigrants in detention and immigrants without legal representation were much more likely than others to be deported. A 2011 report by the group found that 60 percent of detained immigrants did not have lawyers and that 97 percent of detained immigrants who lacked a lawyer were being deported.

“It was heartbreaking to go to Varick Street and to see folks who were without lawyers in these proceedings,” said Jennifer Williams, an immigration attorney with New York’s Legal Aid Society. “Totally have no idea what is going on, how to best defend themselves. They’re shackled in orange jumpsuits. It was appalling.”

Spurred on by these findings, Judge Katzmann’s study group decided to create the New York Immigrant Family Unity Project in 2013, with the goal of creating a pilot program for universal representation that could eventually be expanded to represent every detained immigrant with a hearing at the Varick Street Immigration Court. The City Council funded the pilot program and the Vera Institute of Justice facilitated it.

The pilot grew and became fully funded in 2014 and now funds three organizations to provide lawyers — the Brooklyn Defender Services, the Bronx Defenders and the Legal Aid Society. Attorneys from these organizations meet every immigrant with a hearing at Varick Street, including those detained in New Jersey and upstate New York, and offer their services to anybody whose income is less than 200 percent of the poverty line.

In 2017, Vera issued a report on the first three years of the program and the results were striking. The rate of success — defined as the immigrant’s being allowed to stay in the United States — had risen by 1,100 percent. Before the program was available, potential clients who went unrepresented had a 4 percent success rate, while later clients who were represented through the program had a 48 percent success rate, the report found.

Cases like Carlos’s are a striking example of the need for a lawyer. According to his attorneys, Carlos had been placed in deportation proceedings because of the two previous arrests. In the first, in 2011, he was found in the driveway of a home that had been burglarized, but he had never entered the house. In the second, in 2013, he was charged with assault when he fought to defend his girlfriend against a drunk customer at the restaurant where she worked. Green-card holders can be ordered deported if they commit a crime, which can be as minor as hopping a subway turnstile. But Ms. Lauterback told Carlos he could be eligible for a “cancellation of removal,” considering the larger arc of his life in the United States after serving his jail time.