Julian Zelizer is a history and public affairs professor at Princeton University, editor of " The Presidency of Barack Obama: A First Historical Assessment " and co-host of the "Politics & Polls" podcast. Follow him on Twitter: @julianzelizer . The opinions expressed in this commentary are his own.

On Friday, in an op-ed in The New York Times, he warned fellow Democrats against a rush to talk about impeachment before all the evidence was in front of them. "Let President Trump arouse his voters as he will," Schiff wrote, "while Democrats continue to focus on the economy, family and a return to basic decency. And in the meantime, all Americans should reserve judgment until the investigations have run their course."

These are strong words for the Democrat who has been one of the most vocal critics of Republican efforts to stifle special counsel Robert Mueller's investigation. This is a message that Democrats should read carefully as they head into the midterm season.

After another week of Trump administration chaos, in which Rudy Giuliani has become the new star of Donald Trump's political reality show, Democrats have a great deal to be excited about. Though their lead in the generic ballot has declined , there are many signs that the midterms will be a good day for Democrats. The high number of retirements by Republican incumbents, the outcome of special elections where Democrats took red seats or Republicans barely held on to theirs in deeply conservative territory, and many of the polls continue to point to a possible wave election. And it is important to remember that, historically, midterms almost always go poorly for the party in power.

Yet Democrats, who certainly can't forget the dangers of believing in inevitable outcomes, need to be cautious. Nothing is a slam-dunk in American politics.

JUST WATCHED Are billionaire's impeachment ads backfiring? Replay More Videos ... MUST WATCH Are billionaire's impeachment ads backfiring? 06:08

The biggest challenge for Democrats is to avoid letting anti-Trump fervor drown out their own message. To be sure, attacking the President is often an important part of wave elections. Though they already had control of the House in 1982, Democrats expanded their majority by urging voters to take a stand against the Reagan Revolution. In 1994, Newt Gingrich used President Bill Clinton -- and his failed health care plan -- as a foil to excite voters to turn out in the election. Nancy Pelosi returned the favor in 2006 as Democrats were determined to send a message to President George W. Bush, just as Tea Party Republicans did in 2010 when they took back the House.

But in each of those cases the anger toward the incumbent president was combined with a program or agenda.

In 1982, Speaker Tip O'Neill rallied Democrats around a theme of "Fairness," assuring voters the party would protect the social safety net and reverse the regressive economic policies of an administration that had left working Americans struggling in the middle of the recession. Gingrich had his 10-point Contract with America, a laundry list of promises that Republicans vowed to fulfill if they took power. They would impose term limits, reform congressional spending and boost defense spending.

Democrats in 2006 vowed to bring the war in Iraq to an end and restore the social safety net policies that the administration had stripped away. Tea Party Republicans continually blasted President Barack Obama, but they also spoke to their supporters about the urgency of cutting government spending and cleaning up the way that Washington worked.

Trump poses a particular challenge since the turmoil and scandal coming from the Oval Office often overwhelm the amount of public space available for discussion about other issues. Democrats are making a big political bet if they think that the news over Russia, payments to porn stars and ongoing lies will be enough to bring voters out to the polls. This is especially risky given that unemployment is now at historically low 3.9% and Trump might be on the cusp of helping to orchestrate a major peace deal between North and South Korea.

Democrats are also confronting some extremely bitter internecine primary competitions that could dampen voter turnout in the general elections if they are not handled with care. The national party has been coming down hard in certain primary competitions, placing immense pressure on upstart challengers to get out of the race so that the favored candidate can run a clean race. In The New York Times, Alexander Burns has recounted the forceful intervention of the Democratic National Committee in areas in California, Arkansas and New York.

The intervention has sometimes produced a backlash among voters who resent national officials making the decision for voters. The 2016 primaries revealed that there are some pretty deep and unresolved tensions within the party. As they attempt to protect "safer candidates" who stick to the economy and look like Conor Lamb -- winner of Pennsylvania's special House election -- national Democrats have the potential to try to stifle candidates who are talking about crucial issues such as gun control and sexual harassment. The Intercept recently published a recording of Steny Hoyer , the second-ranking Democrat in the House, pressuring a candidate in Colorado, Levi Tillemann, to get out of a primary and make way for the party's preferred candidate.

Follow CNN Opinion Join us on Twitter and Facebook

Given that midterm elections are primarily about turnout, primary battles that leave too many voters upset and unmotivated, rather than inspired, could have a detrimental effect when it comes time for competitive general elections.

The best news for Democrats is that at the grass-roots level, hundreds of thousands of hard-working citizens have been organizing and mobilizing since the start of this presidency to take back control of Congress. As Lara Putnam and Theda Skocpol argued in Democracy: A Journal of Ideas , thousands of women in suburbs, cities and small towns in key electoral counties have been doing the grunt work that is needed to create a true political counter-mobilization for 2018 and 2020.

But taking advantage of the political window that Trump has created for Democrats won't be an easy victory. Democrats must avoid two big pitfalls -- failing to deliver a compelling agenda and dampening their own turnout though excessively hard-line tactics in the primaries. And that could leave Republicans in much better shape than they otherwise would be in the age of Trump.