If Donald J. Trump seems a little on edge lately, so does the city where he made his name.

The former president, after largely eluding legal accountability of any kind for decades, has now been indicted by a grand jury in a case brought by the Manhattan district attorney, Alvin Bragg.

So far Mr. Trump has handled the investigation, which has looked into whether he broke laws while paying hush money to a porn star ahead of the 2016 election, exactly as one might imagine: with the minimum amount of class and the maximum use of racist slurs. Not only has he made sure everyone knows Mr. Bragg is Black, he has also suggested he is subhuman.

“HE IS A SOROS BACKED ANIMAL,” the former president told his followers on Truth Social while waiting for the indictment, using anti-Black racism as well as antisemitism to describe Mr. Bragg. Mr. Trump also called for widespread protests before he was indicted and predicted “death and destruction,” forcing law enforcement agencies to prepare for possible violence in the streets on Tuesday, when he is expected to be arraigned.

All of this has made New York City, his former hometown, a bit anxious, too. The wait for Mr. Trump’s arraignment and any backlash that may come from it has the city unnerved.

Few Americans have seen Mr. Trump shimmy his way out of a jam more often than New Yorkers. We’ve seen him bounce back from bankruptcy six times, and he has never been truly held to account for his long history of excluding Black people from the rental properties that helped make him rich. We’ve seen his political fortunes soar despite credible claims of sexual assault and tax fraud. We’ve watched up close his gravity-defying, horrifying metamorphosis from a tacky real estate developer and tabloid fixture into a C-list celebrity and, finally, a one-term president with authoritarian aspirations.

Given that history, the idea that Mr. Trump will soon be fingerprinted and booked in a New York courthouse has left many in disbelief. A kind of collective angst over the Trump prosecution has settled over New York City, where many deeply disdain him but seem unconvinced he will ever truly be held to account.

During a recent stage performance of “Titanique,” the hit musical comedy and glitter-filled parody of the 1997 film about the doomed ship, Russell Daniels, the actor playing Rose’s mother, let out a kind of guttural scream. “It’s not fair that Trump hasn’t been arrested yet!” Mr. Daniels cried. Inside the Manhattan theater, the audience roared.

In Harlem recently, the Rev. Al Sharpton held a prayer vigil for Mr. Bragg, who received threats after Mr. Trump used his social media platform to share a menacing photograph of himself with a baseball bat juxtaposed with a photo of the district attorney, in a clear hint of his violent mind-set.

“We want God to cover him and protect him,” Mr. Sharpton said, referring to Mr. Bragg. “Whatever the decision may be, whether we like it or not, but he should not have to face this kind of threat, implied or explicit. Let us pray.”

New Yorkers, weary and still recovering from the pandemic Mr. Trump badly mismanaged, are also now bracing themselves for the possibility of demonstrations by the former president’s supporters. In the hours after the indictment on March 29, N.Y.P.D. helicopters hovered over the courthouses of Lower Manhattan and officers set up barricades along largely empty streets. The Police Department ordered all roughly 36,000 uniformed members to report for duty amid bomb threats and the arrest of one Trump supporter with a knife.

The inevitable spectacle began on Monday, when television helicopters tracked every inch of Mr. Trump’s motorcade from LaGuardia Airport to Manhattan, as if he were visiting royalty. The courthouse area downtown is expected be largely closed to traffic on Tuesday. All Supreme Court trials in the Manhattan Criminal Courts Building will be adjourned early. There are also police lines and TV trucks around Trump Tower, where the former president stayed on Monday night. Meanwhile, Republican groups and Trump supporters are planning or sponsoring rallies nearby, one of which will be addressed by Representative Marjorie Taylor Greene, who will bring her destructive rhetoric up from Georgia.

Of the four known criminal investigations Mr. Trump faces, the Manhattan case is seen by some legal experts as the least serious, in part because it may involve allegations of campaign finance violations before his presidency rather than attempts to abuse his office by overturning the results of an election or inciting supporters to effectively overthrow the United States government. Fair enough.

Still, it’s a poetic irony that the former president will face his first criminal indictment in New York City, the town where he sought to burnish his “law and order” credentials. In 1989, Mr. Trump took out a notorious ad in several newspapers, including The New York Times, calling for the reinstatement of the death penalty when a group of Black and Latino teenagers were accused of the sexual assault of a jogger in Central Park. After serving prison sentences that varied from six to 13 years, the teens were exonerated.

“What has happened to the respect for authority, the fear of retribution by the courts, society and the police for those who break the law, who wantonly trespass on the rights of others?” Mr. Trump wrote in the 1989 ad. “How can our great society tolerate the continued brutalization of its citizens by crazed misfits?”

Over many years, New York has learned a painful lesson. Mr. Trump and his many misdeeds are best taken seriously.