Stay at home this Thanksgiving, and save lives: It’s the latest warning from public health officials as coronavirus cases and hospitalizations across the country rise, urging Americans not to congregate for feasts and family gatherings in hopes of stemming the spread of the deadly virus.

Philadelphia has banned all public and private gatherings through the New Year. Pennsylvania Health Secretary Rachel Levine has recommended against residents holding holiday celebrations with anyone outside their households. New Jersey Gov. Phil Murphy, too, has announced tighter restrictions on indoor and outdoor crowds. And the Centers for Disease Control and Prevention has stressed that the safest way to spend the holidays is with those you live with.

The recommendations are backed by science: Limited contact with others is the best way to curb the spread of the virus. (Testing before going to a gathering isn’t necessarily foolproof, either.)

The Pennsylvania Health Department has said it will enforce its travel order requiring anyone coming from another state to have a negative COVID-19 test within 72 hours ahead of entering the commonwealth or quarantine for two weeks after arriving in Pennsylvania. (Under the Disease Prevention and Control Law, the commonwealth may fine those who fail to comply between $25 and $300, said Health Department spokesperson Nate Wardle.)

But largely, officials have said it’s up to individuals to see the restrictions through. And, nine months into the pandemic, the societal will to follow the rules is down, and people are taking more risks in the face of mounting case counts, hospitalizations, and deaths.

» READ MORE: Can I see my friends and family for Thanksgiving if I quarantine for two weeks?

“Because the spread is mainly happening in private settings,” Philadelphia Health Commissioner Thomas Farley said last week, “our success depends on what Philadelphia residents do on their own.”

How effective can restrictions be if they’re not enforced?

“First, most Philadelphians know that these restrictions are beneficial and will save lives and will take these recommendations or restrictions and implement them into their lives without the need for enforcement,” said James Garrow, spokesperson for the Philadelphia Health Department. “Second, it is our hope that for people that might not readily integrate those recommendations into their lives, hearing that the recommendations are required may be the thing to make them sit up and take notice.”

» READ MORE: Pandemic fatigue and the holidays threaten to swamp Pa. hospitals with COVID-19 cases

During widespread health crises like the coronavirus pandemic, repeated and consistent messaging in media from authorities on what’s OK is crucial to shaping public opinion, and therefore, how the public decides to follow the rules, said Hyunmin Lee, a Drexel University communications professor who specializes in media psychology in health contexts.

“By continuously providing information, it allows the public to also continue to think about that issue,” Lee said. “And whether they like it or not, it becomes that much [more] salient and prominent, and therefore ... accessible as a thought in the public’s mind.”

And for those who don’t like being told what to do, Lee said recommendations like telling people not to gather but allowing them to decide for themselves can actually, in some cases, prove more effective.

» Here are Philly’s current COVID-19 guidelines:

“Counterintuitive to what public health officials might think, that it has to be absolutely restrictive or it has to be legally binding to be effective ... these type of recommendations could be more effective, because they like feeling in charge,” Lee said. “They like to inform themselves and make a decision for themselves.”

And for those on the fence about attending a family holiday gathering, for example, Lee said, official health messaging can empower decisions about staying home.

The power of messaging

Similar messaging worked in Philadelphia before, Garrow said. When the city implemented stay-at-home orders in the spring, he said the health department saw “unprecedented drops in mobility” via data from cell phone providers.

“We told people to stay home, didn’t arrest anyone for being out, and they stayed home,” Garrow said. “When we began really pushing the mask recommendations in late spring and early summer, mask use skyrocketed, approaching 90% in some areas. We have hopes that people will see how seriously the City of Philadelphia is taking this rise in cases and react accordingly.”

» READ MORE: People are still engaging in risky behavior, despite rising COVID-19 cases. Psychologists explain why.

But in the end, it comes down to needing “Pennsylvanians to do the right thing,” Wardle said.

“We know that mitigation efforts work, but we need the general public to follow the mitigation steps,” he said. ”We can follow the orders in place, we can wear a mask, we can avoid travel and gatherings, we can wash our hands, we can social distance, and we can stay home if we are sick.”