But anti-abortion activists said the efforts in some states like New York and Virginia to remove certain barriers to second- and third-trimester abortions allowed them to present the issue to voters in a new and graphic light. Democrats have struggled to defend the new legislation; privately some say they are not being persuasive in explaining the health situations the bills address while the other side accuses them of condoning infanticide.

While polls show that Americans support allowing abortion in the first three months by wide margins, that support drops sharply when people are asked in general about the second and third trimesters. (They overwhelmingly support exceptions if the mother’s life is endangered.)

“We’re in a totally different environment,” said Mallory Quigley, vice president of communications for the Susan B. Anthony List, a group that opposes abortion rights and that plans to test messages on the issue with voters in the months ahead.

Democrats say they cannot let Mr. Trump and other Republicans go unanswered as they try to link the party to socialism — a term that Americans view negatively over all — and to extremism in a broader sense. That has been the motivation behind Republicans’ intense focus on two young, freshman members of Congress: Ms. Ocasio-Cortez, the congresswoman from Queens who calls herself a democratic socialist; and Ilhan Omar of Minnesota, whose criticism of Israel led the president and others to condemn her as an anti-Semite. Some of Ms. Omar’s most vocal defenders have been self-described democratic socialists.

Even if Americans say they like policies that are derivative of socialism, like Social Security, the term “connotes very clear imagery to people in a very dog whistle kind of way,” said Jefrey Pollock, president of the Global Strategy group, which advises Democrats on messaging. “Then they attach faces to it,” he added, “and I think it can have resonance, and it has had resonance.”

The effort on the right to elevate Ms. Ocasio-Cortez, 29, as the most prominent socialist foil is something Democrats are watching, Mr. Pollock said. “She is, of course, six years away from being able to run for president. But they are still trying to make her the face of the party.”

Conservatives have extended this line of attack beyond candidates like Mr. Sanders, who identifies as a democratic socialist. They are using it on other 2020 contenders like Pete Buttigieg, the mayor of South Bend, Ind. Laura Ingraham, the Fox News host, last week accused Mr. Buttigieg’s father, who died recently, and who had taught at the University of Notre Dame, of being “a committed Marxist, who affectionately embraced the Communist Manifesto.” She cited a Washington Examiner report as evidence.