The latest version of Trumpcare is dead, and John McCain killed it. In the wee hours of Friday morning, McCain cast the 51st vote against “skinny repeal,” a Republican Senate bill designed to dismantle Obamacare. Trumpcare could return in another form, and we shouldn’t oversell McCain’s heroism: Two other Republicans, Susan Collins and Lisa Murkowski, joined Democrats in opposing the bill. Furthermore, over the years, McCain has been highly selective about bucking his party. But on this night, his surprise vote made the difference. And before he cast it, he gave us a prescription for curing the illness of Trumpism.

On Tuesday, returning to the Senate floor with a grim cancer diagnosis, McCain delivered a 15-minute speech about bipartisanship. It’s a trite topic, McCain’s delivery was boring, and my friends expected him to prove his insincerity by voting for skinny repeal. But he didn’t. Apparently, McCain’s words meant something. I think it’s worth going back to consider what.

To me, McCain’s speech presents a way of thinking and conducting oneself that’s diametrically opposed to President Trump’s way. A Republican who behaves as McCain proposes is someone Democrats can work with. Indeed, Democrats should emulate such a person, even if McCain himself sometimes doesn’t. Fixing our health care system is just the beginning. To escape the moral rot of Trumpism, all of us should follow these rules.

1. Tell the truth. Trump is a liar, and he has drawn his party into a corrosive culture of deceit and self-deception. Most Senate Republicans knew that skinny repeal, as legislation, was a fraud. They voted for it anyway, because they wanted to get to a conference committee and because voting for a major bill that you wouldn’t want to become law has become, in Trump’s party, just another charade that doesn’t matter. But it mattered to McCain. On Tuesday, he said he would vote against the bill because “it’s a shell.” Three days later, he did just that.

2. Focus on helping, not winning. Trump talks incessantly about beating the enemy. He talks this way not just about other countries, but about Democrats, the media, federal watchdogs, and dissenters in his own party. When you fixate so obsessively on winning, you forget what the point of winning is, and you end up “winning” things that are actually losses. Trump cared so much about beating Hillary Clinton, for example, that he became a tool of Vladimir Putin. Then Trump rallied Republicans to back a series of bad health care bills, none of which he understood, on the grounds that failure to pass them would represent political defeat. McCain confessed to the same mindset, but with shame and regret. “Sometimes I wanted to win more for the sake of winning than to achieve a contested policy,” he told his colleagues. He chastised the administration and his party’s leaders for pushing a health care bill that wouldn’t help ordinary people.

3. Resist proudly. Trump and his surrogates see dissent as unpatriotic. They call Democrats “obstructionists” and demand that Republicans fall in line. McCain sees it differently: Dissent and the separation of powers are fundamentally American, and they keep us free. “We are an important check on the powers of the executive,” McCain told his fellow senators. “Whether or not we are of the same party, we are not the president’s subordinates. We are his equal.” Cynics shrugged off this pronouncement, figuring McCain wasn’t serious about defying the president. He surprised them.

4. Respect the process. Checks and balances aren’t just about resisting power. They’re also about producing better laws by vetting proposals. Trump doesn’t understand this. That’s why, in the name of “extreme vetting,” he rushed out a sloppy executive order to block foreign travelers. It’s also why his party’s health care bills have been so bad: House Speaker Paul Ryan and Senate Majority Leader Mitch McConnell did everything possible to shield the bills from hearings, amendments, media access, Congressional Budget Office analyses, and other layers of scrutiny. In his speech, McCain pleaded for a return to these elements of “regular order.” Such talk about process is boring, but it’s important. It’s how our system filters bad ideas.

5. Ignore the outrage industry. Trump’s threats to “let Obamacare collapse” and use it as a political weapon illustrate his failure, after six months in office, to accept the responsibility of governing. He does this because it’s easier to rally crowds against Washington than to fix things. He pays more attention to Sean Hannity than to Susan Collins.

McCain rejects this behavior. “Stop listening to the bombastic loudmouths on the radio and television and the internet,” he told his colleagues. “Our incapacity is their livelihood.” That’s exactly right: Radicals thrive on dysfunction, and it’s easy to get caught up with radicals on your side who flourish symbiotically—through fundraising, recruiting, and clicks—with the radicals you denounce on the other side. Work with people who would rather have an acceptable solution than a righteous complaint.

6. Fight for values, not for a tribe. Trump has explicitly endorsed torture, religious discrimination, ethnic prejudice, targeting civilians, and stealing the resources of other countries. McCain, in his remarks, condemned these ideas and lamented the Senate’s descent into “tribal” feuding. “We don’t covet other people’s land and wealth,” said McCain. “We don’t hide behind walls. We breach them.” Yes, you can argue that McCain and other hawks have violated these principles in Iraq and other conflicts. But the words still matter, even if McCain is just mouthing them. They remind us of what we should be and why America is more than just another country.

7. Don’t be obnoxious. To fail as spectacularly as Trump has, backed by a fresh election and full control of Congress, takes work. How has he managed it? By insulting and picking fights with everyone, including his aides, members of his Cabinet, and many Republican lawmakers. Trump’s jab at McCain two years ago—“I like people that weren’t captured”—probably didn’t help him get the senator’s vote on health care.

Don’t make the same mistake. You may hate 90 percent of McCain’s voting record, but you need his vote. Don’t alienate him or other Republicans gratuitously. McCain acknowledged on Tuesday that he’s been guilty of this: “Sometimes I made it harder to find common ground because of something harsh I said to a colleague.” Learn from his mistakes.

8. Seek acceptance, not just conquest. Republicans are still steamed that President Obama, in their view, circumvented them by changing policy through executive orders. Trump has responded with his own executive orders, which in turn will be discarded by the next Democratic president. McCain proposes a different approach: “compromises that each side criticizes but also accepts.” The acceptance is key, because, as the health care debate illustrates, even if your party can supply enough votes in Congress to enact a policy, getting buy-in from the other side will make your policy far more secure.

9. Do what’s right, even if it’s unpopular. Trump flatters and manipulates crowds. He turns them against their interests by appealing to resentment of immigrants, minorities, the press, and other popular targets. McCain, in his remarks on Tuesday, urged senators to take a different approach: to be “more deliberative” than the House, as the founders intended, and to work “at a greater distance … from the public passions of the hour.” Trump demanded that Republicans pass skinny repeal because they had promised to end Obamacare; McCain asked them to focus on the job, not on fulfilling their rhetoric.

10. Heal thyself. On every issue, including health care, Trump blames Democrats. This habit of deflecting responsibility isn’t just unfair to the people you blame; it also keeps you from grappling with the problem you’re most capable of solving: your role in the cycle of dereliction and cynicism. As McCain lamented the rise of partisanship and parliamentary tricks, he repeatedly cited himself and his party as culprits. He stung his Republican colleagues by observing that in the debate over Obamacare, “All we’ve managed to do is make more popular a policy that wasn’t very popular when we started trying to get rid of it.” Republicans would be wise to ask how that happened. And Democrats would be wise to consider why, seven years later, the program remained unpopular.

Does McCain live by these rules religiously? No. He has bowed to his party’s orthodoxies too often, and like other Republican elders, he has failed to stand up to Trump’s abuse of office. But what McCain said on Tuesday, and what he did on Friday, was right. We should take his words seriously.