Hours after the Supreme Court announced the death of Justice Ruth Bader Ginsburg on Friday, Sen. Mitch McConnell of Kentucky, the majority leader, vowed that the Senate would vote on a replacement named by President Donald Trump, setting up what is all but guaranteed to be a heated fight over the nation’s highest court that carries heavy political consequences.

That statement answered the question of whether McConnell, who in 2016 blocked President Barack Obama’s Supreme Court nominee because it was an election year, would dare try to confirm one named by Trump so close to an election. He would. Now the question is, can McConnell pull it off?

The process is likely to be ugly, but it can be done. Here’s how it works.