The general election showed me how wrong I was. To my surprise, Mr. Obama won handily, taking states that Democrats hadn’t won in generations. And though I haven’t agreed with everything he’s done, he’s had one of the most successful presidencies in a very long time.

The stakes today are much higher. Unlike Senator John McCain, the Republican nominee in 2008, Donald J. Trump is dangerous. He believes in one thing and one thing only — Donald Trump. And make no mistake: Donald Trump can win. He has already proved that, and he’s as much a threat in the general election as he was to his opponents in the primaries.

Senator Bernie Sanders’s role in this campaign has been valuable — he has introduced important issues and excited millions of new voters. Mr. Sanders has earned the right to compete in the remaining primary contests and stay in until the convention — as Mrs. Clinton did in 2008. But rules are rules, and the math is the math. Senator Sanders is not going to be the Democratic nominee. There’s staying in a race to cross the finish line with your head held high, and then there’s participating in or condoning language and actions that will damage the nominee and help Mr. Trump.

So to all the Sanders staff members and supporters who are as hurt and dismayed as I was, who feel that their candidate is right and the opponent dead wrong, who want to keep fighting to the convention and beyond: I get it. I’ve been there (with Howard Dean and Bill Bradley as well). But please learn what I have learned and don’t let your anger get the best of you. The consequences of doing anything that will help Donald Trump win are catastrophic.

I understand you may not love (or even like) Mrs. Clinton right now. Perhaps you can’t imagine knocking on doors for her in the cold or donating your hard-earned money to finance her campaign. I’m doing both of those things, but I realize that you may not want to. I felt the same way about Mr. Obama in 2008. In the end I didn’t work hard to get him elected (I really regret that now, by the way), but neither did I do or say anything that would harm his chances. I came to accept that he was, in fact, my party’s nominee and might be the eventual president.