Voters have been saying for months that they don’t like their choices for president this year. Now, the campaign for the White House turns in large part on whether they reward the Democratic Party for giving them a new option.

The race will be shaped significantly by whether Democrats select Vice President Kamala Harris , the likeliest but not inevitable choice, or a different nominee to replace President Biden on the ticket. Republicans have been preparing for a possible Harris candidacy and on Sunday posted an ad attacking her immediately after Biden withdrew from the race . If another candidate surfaces, the election presents the GOP, and the voters, with far more uncertainty.

The main super PAC supporting former President Donald Trump , MAGA Inc., said it would spend $11 million in the next two weeks on the anti-Harris ad, which attempts to transfer Biden’s low approval ratings on inflation and immigration onto Harris. The ad, which began appearing Sunday evening on broadcast TV in the swing states of Pennsylvania, Arizona and Georgia, also says Harris helped mask Biden’s “obvious mental decline.”

That ad is the latest sign Republicans plan to accuse Harris and other Democrats of being complicit in a coverup of Biden’s health challenges and flaws. Trump allies have also claimed that Democrats were subverting the will of their voters by ousting a candidate who had already swept through this year’s primaries.

But Trump and his allies would have to recalibrate if another nominee surfaced. “If it gets announced that other people are going to challenge Harris for the nomination, we may have to go dark’’ and suspend advertising, said a person familiar with the PAC’s plans. “It throws everything up in the air.’’

Terry Sullivan, who managed Sen. Marco Rubio ’s 2016 presidential bid, noted that, “The entire Trump campaign has been based on running against the Biden record, from inflation to the border crisis.”

Trump took to social media on Sunday evening to complain about the curveball Democrats had thrown. “So, we are forced to spend time and money on fighting Crooked Joe Biden , he polls badly after having a terrible debate and quits the race. Now we have to start all over again,” he wrote.

Among Democrats, momentum quickly grew around Harris, with a number of prominent governors and lawmakers, including several seen as potential challengers to her, or vice presidential picks, backing her newly announced candidacy. The Democratic fundraising platform  ActBlue said  that, as of 9 p.m. ET, it had pulled in $46.7 million in donations for all Democratic groups in the hours since Harris became a candidate. The group said Sunday was the biggest fundraising day of the 2024 cycle.

Any new nominee gives Democrats a chance to shed the liability of Biden’s age and declining mental acuity, which was on display as the 81-year-old president suffered cognitive lapses during his debate against Trump last month. Harris, 59, presents a very different contrast with Trump, 78, than did Biden.

Biden’s withdrawal also strengthens his party’s ability to turn the spotlight away from the president’s weaknesses and refocus voter attention on Trump’s role in overturning Roe v. Wade, his recent criminal conviction, his attempts to retain power after the 2020 election and record of breaking democratic norms—issues the party believes voters will reject if their nominee can make them salient.

“Biden’s advanced age and diminished abilities were the blinders that didn’t allow voters to focus on the Democrats’ record of accomplishments and the depraved MAGA Republican platform Trump is offering,” said Fernand Amandi, a Florida-based Democratic pollster.

If Harris wins the Democratic nomination, her choice of running mate could also alter the campaign against Trump and his vice presidential pick, Sen. JD Vance (R., Ohio), particularly given the erosion of support for Biden in battleground state polls. Possible ticket mates for Harris include Govs. Andy Beshear of Kentucky, Roy Cooper of North Carolina, Josh Shapiro of Pennsylvania and Gretchen Whitmer of Michigan, as well as Arizona Sen. Mark Kelly.

Both parties will now try to reintroduce Harris to the public . The daughter of Indian and Jamaican immigrants, she is the country’s first Black vice president and the first of South Asian descent. Democrats hope she will revive support from Black, Latino and young voters who normally lean Democratic but weren’t committing to Biden as strongly as in 2020.

At the same time, voters, as of now, don’t hold a more positive view of Harris than they do of Biden, who has drawn the lowest job approval ratings of any president at this point in his tenure dating to Dwight D. Eisenhower, Gallup polling has found. In a Wall Street Journal survey this month, both Harris and Biden were viewed favorably by about 35% of voters and unfavorably by about 56%.

Chuck Rocha, a veteran Democratic strategist and pollster, said Harris would be the party’s best choice of nominee because of her biography and ability to inherit Biden’s campaign cash and infrastructure, both of which would be difficult to transfer to another candidate. “The historic value of her nomination—the first woman of color, the first Asian—in our party, that means a lot,’’ he said.

More broadly, he said, the party now gets “a new burst of energy. Since the debate, it has been the life bleeding out of our party.’’ Harris, he said, “puts us back in the game.”

Trump’s allies had already started looking at Harris’s record as a prosecutor—she was California’s attorney general for six years—for material to be used against her. The Trump campaign was preparing ads focused on her, according to a person familiar with the planning, and aides were highlighting some of her older positions.

It was unclear how Democrats would move forward in selecting a nominee. With the party preparing to hold its nominating convention in mid-August, the convention’s rules committee was expected to meet by Friday to discuss the process.

If a challenger to Harris of significant stature emerged, and the party allowed an open competition for delegates, the result could be the first time a party entered its convention without knowing its nominee in advance since 1976, when then-President Gerald Ford bested Ronald Reagan in securing the final delegates he needed at the Republican nominating conference that year.

Several prominent Democrats said Sunday that they would back Harris, including Biden, former President Bill Clinton and Hillary Clinton , the 2016 Democratic nominee. Notably, former President Barack Obama issued a statement praising Biden but without endorsing Harris, and the Democratic House and Senate leaders didn’t weigh in on a replacement for Biden.

The Trump campaign issued a memo highlighting its strategy of attaching Biden’s policies to Harris. “Harris has been the Enabler in Chief for Crooked Joe this entire time. They own each other’s records, and there is no distance between the two,” read a statement from Trump senior advisers Chris LaCivita and Susie Wiles.

Immigration, in particular, will be a focus for the Trump campaign. Biden asked Harris to tackle the “root causes” that caused people to leave Central America for the U.S., such as poverty, violence and lack of opportunity for women. But she struggled to distance herself from the politics of migrant surges at the border, which wasn’t part of her mandate. The Trump campaign will nonetheless work to fault her for problems at the border, an issue that has proven potent in the election, polling shows.

The Trump campaign is also combing through opposition research files on other potential candidates. Trump is scheduled to hold a rally on Wednesday in Charlotte, N.C., a battleground state.

James Blair, political director of the Trump campaign, pushed back on the discussion that the Trump campaign would face new challenges, given how much it had focused on Biden.

“Our organization is built for our candidate, not our opposition,” he wrote , adding: “The other side now has to shove a new candidate into a team & organization built for someone else. Best of luck.”

Republicans aligned with Trump said there were discussions about initiating legal challenges to a move Biden’s campaign made Sunday to rename three of its fundraising entities, placing them in Harris’s name. Those three, a campaign committee now called Harris for President and two joint fundraising committees, had more than $159 million in cash at the end of June, according to filings with the Federal Election Commission.

Others said Harris could legally use the money. Harris and her running mate “can continue using the campaign’s existing funds for the general election if she is on the Democratic ticket as either the presidential or vice-presidential nominee,” Trevor Potter , president of Campaign Legal Center, said in a statement.

If Harris doesn’t become the nominee, federal rules would allow it to only transfer up to $2,000 to another candidate. Alternately, according to Potter, the Biden campaign can offer to refund its donors, or the campaign can transfer its funds to the national Democratic Party or state parties, which he said are permitted to spend some funds in coordination with the nominee.

Polling has shown that while Republicans were more enthusiastic about Trump than Democrats were about Biden, voters overall were unhappy that the election was a rematch between two men in their 70s and 80s.

In the Journal survey this month, both men were viewed more unfavorably than favorably. Nearly half of voters said they would replace both candidates with new choices if they could, and an additional 26% said they would replace one candidate or the other. Only 22% said they would keep both men on the ballot.

While the campaign has publicly dismissed Harris’ ability to defeat Trump, some officials privately said that they aren’t taking their current lead in the polls for granted, acknowledging that Harris could pull in women and minority voters who the Trump campaign has been courting.

Trump warned against complacency during a rally Saturday in Grand Rapids, Mich., saying the next four months is “like an eternity.” Though Trump has railed against early voting, he asked supporters to vote any way possible, and video screens directed people to a website called Swamp the Vote. Trump went after Harris during the rally. “I call her laffin’ Kamala,” he said. “You can tell a lot by a laugh. No, she’s crazy. She’s nuts.”

Harris has been criticizing Trump on abortion and other issues on a near-daily basis. On Sunday, shortly after Biden’s announcement, she said on X that she would do everything in her power to unite the party to defeat Trump’s “extreme” agenda and asked donors to pitch in.

Write to Aaron Zitner at aaron.zitner@wsj.com , Alex Leary at alex.leary@wsj.com and Vivian Salama at vivian.salama@wsj.com