Former President Barack Obama Friday accused President Trump of “capitalizing on resentment” and called on voters to engage in the midterm elections, which he said are “more important than any I can remember in my lifetime.”

“Just a glance at recent headlines should tell you that this moment really is different, the stakes really are higher, the consequences of any of us sitting on the sidelines are more dire,” Mr. Obama said in a speech at the University of Illinois. “This is not normal.”

Mr....