This is not an elegy for heroin, a dangerous drug in its own right that spread from cities into suburbs and rural areas about a decade ago, when addictive prescription painkillers became harder to get. But for longtime urban users like Mr. Miller, many of them African-American, its disappearance is taking a particular toll. From 2016 to 2017, the fatal overdose rate from fentanyl and other synthetic opioids increased by 61 percent among black Americans, compared with a 45 percent increase for whites.

The number of overdose deaths involving heroin has been dropping, even as overdose deaths over all have kept climbing because of fentanyl. In Maryland, deaths involving heroin fell by 38 percent from 2016 through 2018, according to preliminary data. In Massachusetts, heroin or likely heroin was present in 71 percent of opioid-related deaths in 2014; in the third quarter of 2018, it was present in only 34 percent.

And in New Hampshire, which did not have a robust heroin market until the painkiller-fueled crisis of the past decade, the drug has almost completely vanished. Only four of the 397 opioid deaths in New Hampshire last year involved heroin, according to preliminary data; 363 involved fentanyl .

“In this situation, heroin looks protective compared to the fentanyl,” said Dr. Daniel Ciccarone, a family physician and researcher at the University of California, San Francisco, who has studied both drugs.

Nationally, there were 7 percent fewer deaths involving heroin in the year ending in September 2018 than there were in the previous year, according to preliminary data from the Centers for Disease Control and Prevention. The smaller overall decline may be a reflection of heroin’s continued strong presence in Western states like California and Arizona.

Data on drug seizures similarly suggest a diminishing of heroin. Here in Baltimore, Todd C. Edwards, a spokesman for the Drug Enforcement Administration’s local district office, said law enforcement was now seizing more fentanyl than heroin. And in a Philadelphia neighborhood called Kensington, which has been hit particularly hard by opioid addiction, users report that “they can’t find heroin anymore,” said Patrick Trainor, a spokesman for the D.E.A. there. “It’s pretty much been replaced.”