Having had more than two weeks to ponder one of the most humiliating presidential defeats in its history, the Democratic Party is moving to apply its lessons to the legislative battles ahead, as well as to the daunting but essential task of rebuilding the party’s fortunes.

Much of the burden will fall on Democrats in the closely divided Senate, where arcane rules give the opposition party leverage to shape or block legislation passed by the rigidly conservative, Republican-dominated House. The challenge facing the Senate minority leader, Chuck Schumer, is to determine when to say no and when to compromise on matters of broad economic benefit.

Mr. Schumer vows to block all efforts to kill Obamacare, or gut Dodd-Frank financial regulation. “We’re not going to undo it, period. And I have the votes.” And the Democrats are sure to resist ideas they abhor — a far-right Supreme Court nominee, or efforts to undermine environmental protections. Yet other issues in which both sides and the larger public have an interest, like infrastructure, could offer room for collaboration.

The stakes are high: In 2018, 10 Senate Democrats must defend their seats in states that Mr. Trump won. Democrats are desperate to do better in 38 governors’ races in the next two years, and in state legislative races, since state legislatures will determine the shape of congressional districts after the 2020 census.