Grover Cleveland was our 22nd and 24th President (1885-1889, 1893-1897). No other president has ever served non-consecutive terms. He defeated James G. Blaine in 1884, lost to Benjamin Harrison in 1888 (despite winning the popular vote), and then came back to defeat Harrison in 1892. Donald Trump would be the second person in history to do this should he win the next election.
There are some similarities between their situations but mostly they are nothing like each other. Cleveland was never impeached, did not try to downplay a major pandemic costing thousands of Americans their lives, lost gracefully rather than making up a lie about a rigged election or incite a mob to march to the Capitol to overthrow the democratic process so he could remain in office. And of course the most visible difference: Cleveland was sane.