There are two major points to consider before answering this question. The first is that your answer will generally be influenced by your own political views. The second is that this distinction becomes much less important as you go back in history. President Obama and President Trump are still controversial; their legacies are disputed, and Democrats have very different views from Republicans. President Lincoln, however, is admired across the political spectrum.
Abraham Lincoln is, in fact, often chosen as the greatest president by both liberals and conservatives. He was ranked top by both groups in the influential Murray-Blessing survey of 1982, which was conducted amongst historians. There was also minimal disagreement that the other highest-ranking presidents were George Washington, both Roosevelts, and Thomas Jefferson.
Washington and Lincoln are both good choices because their achievements are obvious. Herbert Hoover is often selected as one of the worst presidents for his role in exacerbating the Great Depression. One pairing which would certainly make sense and be easy to defend would be to choose Abraham Lincoln as the greatest president, and James Buchanan, his immediate predecessor, as the worst. You might then say that Buchanan helped to create the problems that led to the Civil War, including the spread of slavery and allowing Southern states to secede. Lincoln then played a leading role in solving these problems, ending the war and freeing the slaves.