With sheriffs vouching for them and a flood of ads proclaiming their support for the police, Democrats are shoring up their public safety bona fides. Still, some worry it’s too late.In the final stretch of the midterm campaigns, Democrats are straining to defend themselves against a barrage of crime-focused attacks from Republicans, forcefully highlighting their public safety credentials amid signs that G.O.P. messaging on the issue may be more potent than usual in some critical races this year.Democrats have enlisted sheriffs to vouch for them, have outspent Republicans on ads that use the word “police” in the month of October, and have been using the kind of tough-on-crime language that many on the left seemed to reject not long ago — even as some Democrats worry that efforts to inoculate the party on a complex and emotional issue are falling short.Representative Sean Patrick Maloney of New York, who is being criticized over a 2018 video in which he called ending cash bail a “top priority,” aired an ad in which an officer declared him a “tough-on-crime” lawmaker who confronted those “who wanted to defund the police.”Senator Catherine Cortez Masto of Nevada has long highlighted her pro-law enforcement credentials, including with an ad featuring a police chief praising her record of being “tough on crime.”And Lt. Gov. John Fetterman of Pennsylvania, whose history on criminal justice issues is being denounced by Republicans, sounded pro-law enforcement notes at a senior center on Friday as he discussed his tenure as the mayor of Braddock, Pa., saying he “was proud to work with our police departments, and funding the police.”Nationwide, Democrats spent more money last month on ads that used the word “police” than Republicans did, according to AdImpact, a media-tracking firm. But heavy Republican spending on crime ads earlier this year has helped define the final weeks of the campaign in states like Pennsylvania and Wisconsin.Cheri Beasley, the Democratic nominee for Senate in North Carolina, has highlighted supporters with law enforcement backgrounds in her campaign.Logan R. Cyrus for The New York TimesNational crime trends are mixed and complex, and Republicans have often reached for arguments about crime or border security, with varying results. Some party strategists doubt the issue will be decisive this year, with many Americans far more focused on economic matters.But a Gallup survey released late last month found that “Americans are more likely now than at any time over the past five decades to say there is more crime in their local area than there was a year ago.”The issue, fanned and sometimes distorted by conservative news outlets, has been especially pronounced in liberal-leaning states, including New York, Pennsylvania, Oregon and Wisconsin, where big cities have struggled with concerns about violence and quality of life over the last few years. But the topic is at play in many tight Senate, House and governors’ races.The State of the 2022 Midterm ElectionsElection Day is Tuesday, Nov. 8.Biden’s Speech: In a prime-time address, President Biden denounced Republicans who deny the legitimacy of elections, warning that the country’s democratic traditions are on the line.State Supreme Court Races: The traditionally overlooked contests have emerged this year as crucial battlefields in the struggle over the course of American democracy.Democrats’ Mounting Anxiety: Top Democratic officials are openly second-guessing their party’s pitch and tactics, saying Democrats have failed to unite around one central message.Social Security and Medicare: Republicans, eyeing a midterms victory, are floating changes to the safety net programs. Democrats have seized on the proposals to galvanize voters.Celinda Lake, a veteran Democratic pollster, said the most effective responses had come from candidates who formulated a message on crime early.“Too many Democrats waited until the attacks on crime happened,” she said. “We’re never going to win on crime. We just have to answer it strongly enough to be able to pivot back to other issues to show we’re in touch.”Some Democrats fear that their party has fallen short. In an article on Thursday for The American Prospect, a liberal magazine, Stanley B. Greenberg, a longtime Democratic pollster, warned that the party was still struggling with a branding problem, even though many Democrats distanced themselves long ago from the “defund the police” movement that gained traction after the police killing of George Floyd in 2020.Billboards in Philadelphia attacked Lt. Gov. John Fetterman, the Democratic nominee for Senate in Pennsylvania, over his record on crime.Michelle Gustafson for The New York TimesMr. Fetterman said that during his tenure as the mayor of Braddock, Pa., he had been “proud to work with our police departments, and funding the police.”Ruth Fremson/The New York Times“‘Defund’ is a very small segment” of the party, Mr. Greenberg said in an interview. “But the whole party owns it.”Steven Law, the chief executive of the Senate Leadership Fund, the leading super PAC for Senate Republicans, said concerns about public safety contributed to the idea that the country is going in the wrong direction — a problem for the party in power.“Crime has an outsized ability to define Democrats as being liberal instead of moderates, more than any other issue,” he added.Democratic officials have tried to address the issue head-on. The party’s Senate campaign arm encouraged candidates to challenge Republicans over opposing measures that would combat gun violence, a committee aide said, and to use law enforcement officials in their advertising.“It’s not just trying to be more Republican than the Republicans,” said Aimee Allison, the founder of She the People, a political advocacy group focused on women of color. “People are interested in how to make communities safer.”And a memo this spring from the Democratic House campaign arm laid out a guide, advising candidates to reject the notion of defunding the police, to highlight law enforcement funding they had secured and to rely on members of law enforcement to endorse their records. It also urged Democrats to “stand up for racial justice.”“In 2020, the Republican lies were so outrageous, some candidates thought they could ignore them,” Mr. Maloney, the chairman of the House Democratic campaign arm, said. “In 2022, we know better.”It is evident that many Democrats are following aspects of that playbook, while also slamming Republicans over the Jan. 6, 2021, attack on the Capitol — another issue the memo noted.Representative Tim Ryan, Democrat of Ohio, who is facing a difficult Senate race, has claimed credit for helping to obtain federal funding for state law enforcement. He has also criticized his Republican opponent, J.D. Vance, over sympathetic statements he made toward rioters at the Capitol, where about 140 police officers were injured.Over the summer, Mr. Ryan ran an ad in which a sheriff called the claim that Democrats want to defund the police “ridiculous” and said he “trusts Tim Ryan to keep our community safe.”Representative Abigail Spanberger, a moderate Democrat in Virginia, made national headlines two years ago for her critique of her party on a leaked post-election call, which included concerns about the “defund the police” movement.This year, Ms. Spanberger said in an interview, Democrats could point to votes serving as “proof points” that they are serious about crime.“We’re appropriating significant money to local police departments,” she said.Representative Tim Ryan, Democrat of Ohio, who is facing a difficult Senate race, has claimed credit for helping to obtain federal funding for state law enforcement. Brian Kaiser for The New York TimesJ.D. Vance, Mr. Ryan’s Republican opponent, has made sympathetic statements toward rioters who were at the Capitol on Jan. 6, 2021.Maddie McGarvey for The New York TimesIn one of Ms. Spanberger’s television ads, a Republican police chief endorsed her while criticizing her opponent, Yesli Vega, for “defending” rioters who attacked the Capitol. Ms. Vega, an auxiliary deputy with the Prince William County Sheriff’s Office, called the rioters “a group of Americans exercising their First Amendment rights.”In Pennsylvania, the Fetterman campaign said it had put out 16 ads mentioning crime or public safety, including at least one featuring the sheriff of suburban Montgomery County, who vouched for Mr. Fetterman.This week, a Monmouth University poll showed that voters trusted both Mr. Fetterman and Mehmet Oz, his Republican rival, equally when it came to handling crime. The poll also noted that Mr. Fetterman’s edge on the issue had evaporated. Mr. Fetterman has defended himself primarily by pointing to his tenure as the mayor of Braddock, outside Pittsburgh, where for five years a scourge of murders came to a stop.The issue has also played a prominent role in other Senate races, including in Wisconsin and, to some degree, North Carolina.Lt. Gov. Mandela Barnes in Wisconsin and Cheri Beasley in North Carolina, the first Black woman to serve as chief justice of the State Supreme Court, have also showcased supporters with law enforcement backgrounds in their campaigns.In Wisconsin, mail advertising from Republicans has darkened Mr. Barnes’s skin, one stark example of the ways attacks on crime can propel issues of race to the forefront.Representative Mark Pocan, Democrat of Wisconsin, said: “Clearly, the message was not just one of crime. It was one of racism.” And, like other Democrats, he alluded to the Capitol riot.“They claim to back the blue, and in reality, they’re backing the coup,” he said. “You can’t pretend to support law enforcement, but then selectively decide which law enforcement that you’re going to protect.”Jon Hurdle contributed reporting from Harrisburg, Pa. More