President Donald Trump’s encounter with COVID-19 is a brutal reminder that the pandemic isn’t contained, let alone in retreat. Handled badly, this new political emergency will compound the dangers facing the country as the elections approach. Handled well, however, it could serve a vital purpose — by helping unite the country in fighting the disease.

The need for bipartisan resolve could hardly be clearer. Before Friday’s news about the president, familiarity with the coronavirus and the cost of measures to control it had engendered impatience and complacency — not only in the White House, but across much of the country.

Meanwhile, case numbers have continued to climb. With 210,000 already dead, a worsening trend of fatalities is all too possible. Now is the moment for renewed urgency, and for proof that the country and its leaders can pull together in a common cause.

This will require greater honesty, and a clearer understanding of who owes what to whom. The protracted muddle over the president’s condition and treatments is a case in point. The doctors attending him are public servants and shouldn’t dissemble or strategize when answering questions that citizens are entitled to ask.

Trump has now returned to the White House, but his chief physician says he “may not entirely be out of the woods.” With the election approaching, voters should be told everything they need to know about the president’s health. The same goes for the health of former Vice President Joe Biden.

Ideally, the candidates and their allies would agree — and be seen to agree — that masks and social distancing need to be taken more seriously. With the pandemic still spreading, caution and responsibility are paramount. Many people might choose not to follow this direction, but if the country’s politicians can unite on the point, a vital public purpose will be served regardless. This ordeal needs to bring the country together, not divide it still further.

The nation’s leaders can help guide good behavior by campaigning responsibly as well as energetically. That doesn’t mean hiding from the public: It’s their duty to be seen and heard, and a bunker mentality is not what’s required. But it does mean avoiding pointless risks to themselves and others.

The president’s excursion in a motorcade outside Walter Reed National Military Medical Center on Sunday, with Secret Service agents in close attendance, was an example of what not to do.

The candidates in next month’s elections can fight about everything else, but need to unite on this: Defeating the pandemic comes first.