Though one of its own sits yet again in the White House, the baby-boom generation, 78 million strong, is finally preparing to depart the scene. Theirs is a 40-year legacy of war, debt and cultural conflagration. The boomers won’t leave a vacuum when they go, however. The young and hungry millennials — roughly speaking, those between 18 and 35 — are licking their lips. Numbering 80 million, these tech-savvy kids are the largest generational cohort in American history, and they’re preparing to seize the commanding heights of the economy and culture.

Given their size and cultural clout, the millennials could conceivably jump the queue, crowding out the more traditional priorities and preferences of the intervening Generation X, those roughly between ages 37 and 52 — and setting the terms of the national debate on everything from the economy to the future of free speech.

Gen-Xers have often been described as reticent, certainly compared with the generations before and after them. It might be time to shed this habitual reluctance, however: If they don’t assert themselves soon, they risk losing their ability to influence the direction of the country.

Born between about 1965 and 1980, Generation X came of age in the 1980s and early 1990s. The oldest members of this cohort remember Watergate as children; the youngest are still forming their families today. Most became politically aware during the Reagan-Bush or Clinton years. They are more conservative than millennials and less partisan than boomers. Their outlook was shaped by a childhood defined by broad-based domestic prosperity, slow but steady technological progress, relative racial harmony and social stability, and the Cold War triumph over the Soviet Union.

They were raised with the expectation of inheriting a world at peace, enforced by the global supremacy of the US military, but also a world in which sexual relations were haunted by the specter of AIDS. They were taught in school that doing drugs was dangerous, premarital sex was to be avoided and there were, in fact, just two genders.

Members of Gen X have fallen well behind the boomers when it comes to saving for retirement.

The US divorce rate peaked in the early 1980s, just as the oldest Xers entered their teen years. Their mothers entered the workforce en masse. Many became so-called latchkey kids — independent, resilient, slightly cynical. Perhaps jaded by these experiences, Xers got married later than their parents did but have stayed married longer. Like millennials today, Xers were once slandered as sullen, withdrawn and difficult to please.

The charges didn’t stick. As adults, according to the University of Michigan’s Longitudinal Study of American Youth, Xers have become “active, balanced and happy.”

Just 4 percent reported a “great deal of unhappiness” with their lives as they approached middle age.

The outlook for Generation X isn’t all rosy. A 2015 study by J.P. Morgan Asset Management found that members of Gen X have fallen well behind the boomers when it comes to saving for retirement. Xers would have to, at a minimum, double the rate at which they are saving, in order to catch up — not likely, unless the sluggish economic recovery of the last seven years kicks into gear. Other studies have found that Xers are having difficulty saving for retirement in part because they carry more debt than the boomers did. A fair number of Xers think they’ll never be able to retire. They don’t expect Social Security to save them.

Still, they remain upbeat. Nearly half of Xers who responded to a 2015 survey about retirement by Allianz insurance company said they’d “just figure it out when I get there.”

Millennials feel upbeat, too, but for different reasons. Though the oldest of the cohort are only in their mid-30s, their massive numbers threaten to swamp Gen X and push it off center stage. Millennials already constitute more than half the US workforce, and employers are eager to accommodate their habits and preferences. Millennial impatience with traditional business practices is no secret. Many expect to be promoted during their first year on the job. “I think the younger generation obviously wants to move a lot more quickly in positions than maybe the more senior folks like me,” said Kathleen L. Flanagan, CEO of the consulting firm Abt Associates, in a 2013 interview with the New York Times.

Markedly less patriotic than boomers and Gen Xers, millennials see nothing special about being American and recoil at the notion of US exceptionalism. A 2016 Gallup poll found that socialism was more popular than capitalism among those under 30.

Nearly 70 percent of millennial survey respondents said they’d be comfortable voting for a socialist candidate. During the 2016 Democratic presidential primary, 80 percent of voters under 30 voted for Bernie Sanders in the early-voting states of Iowa, New Hampshire and Nevada. In 2012, millennials put Barack Obama over the top in a tight race against Republican Mitt Romney.

If Gen X doesn’t get its act together — and fast — it will have the rug pulled out from under it just as it’s on the verge of realizing its potential.

Perhaps most troubling, millennials have displayed an indifference to the bedrock American principle of free speech. A 2015 Pew study found 40 percent of those between the ages of 18 and 34 felt the federal government ought to censor potentially offensive statements about minority groups.

“Roughly two-thirds of college students say colleges should be allowed to establish policies that restrict slurs and other language that is intentionally offensive to certain groups (69 percent), as well as the wearing of costumes that stereotype certain racial or ethnic groups (63 percent),” according to a 2016 Gallup survey. Nearly half of respondents said they thought that there could be some “legitimate reasons” to prevent the press from covering campus protests.

These attitudes set millennials apart from Generation X and the baby boomers, but it’s Gen X that will feel their impact. The advertising world has already begun to turn away from marketing to middle-aged Xers and cater to millennials and their purchasing power. Even the military is scrambling to adapt to the needs of its youngest recruits.

The Army is considering prolonging the amount of time drill sergeants spend with new soldiers during basic training. “The problem that we do have is that right now the generation we have coming in is not as disciplined as we would like them to be,” said an Army spokesman. “So we have to provide them with discipline over a longer period of time.”

The parents and grandparents of the entitled, impatient and politically correct millennials are only partly to blame. The primary culprit is technology. We’re only starting to digest the ramifications of how much the internet has transformed the world and daily life — from how we interact with our friends and neighbors to how we process information. But technology’s influence can be seen most dramatically along generational lines.

With a seemingly blind faith in technology, millennials have a welcoming attitude toward our online future. Born in the 1980s and ’90s, these “digital natives” can’t remember a time when the internet wasn’t standing by, waiting to answer any question, fulfill any request, order any consumer good, transfer funds, shuffle playlists, download books or signal virtues. They don’t remember what it was like to browse the shelves of a bookstore or to call someone to ask for a date. They do that stuff online. That’s what Amazon and Tinder are for.

Most millennials feel comfortable moving human interaction onto the web. They are the main cheerleaders for the flexibility and convenience of the “sharing economy.” They see only benefits from the creative destruction wrought by companies like Uber and Airbnb.

They see no problem moving their personal information and documents to the cloud or wiring up every appliance and device into the “internet of things.” According to one survey, they create and upload twice as much online content as non-millennials.

Rushing headlong into the digital future without considering what we stand to lose — or at least weighing the trade-offs — is grand-scale recklessness. Fifty-four percent of millennials told Time researchers they were more comfortable texting people than talking with them.

In a world that makes it easy to throw anonymous digital stones, the meaning of personal responsibility becomes diluted. Gossip, smears, rumors, lies and threats metastasize online. The conditions for social conflict are optimal. Is it a coincidence that the 2016 presidential campaign was the most scandal-ridden, bottom-feeding election in living memory?

Journalist Nicholas Carr charted the effect that the internet is having on our brains in his 2010 book “The Shallows.” “Our ability to learn can be severely compromised when our brains become overloaded with diverse stimuli online,” he writes. “More information can mean less knowledge.” Worse, says Carr, digital overload makes it harder “to distinguish relevant information from irrelevant information, signal from noise.” In computing terms: Garbage in, garbage out. In human terms, millennials think that if it’s not online, it doesn’t exist.

Given the acquiescence of millennials to the all-online world, Gen X has a formidable responsibility to keep faith with reality. They are the last analog generation. Raised in a pre-revolutionary moment technologically, they are children of books, handshakes, body language and eye contact. They learned — even if they didn’t always appreciate them — the virtues of patience, self-control and delayed gratification. They knew what it meant to be out of contact with someone they loved. Some of them — too few — learned how to fix an engine or wire a light fixture. Most remember how quiet things used to be, how easy it was to be alone.

The brick-and-mortar world has virtues; chief among them is the human contact it enables. What does someone who remembers what it was like to browse the racks of a used-record store say to someone who has never heard a vinyl LP played through stereo speakers? How do you convince someone who’s never called a girl’s house and asked her parents if she was available to come to the phone that it actually took guts to do this, and that it was something to be proud of, something to remember — especially if she said yes? She would go see a movie with you and, yes, you could call her again to talk (not text). It was an entirely different experience from typing “Hey, Wr U at? Let’s conX” and waiting impatiently for a reply.

Gen X is a bridge between the analog culture of the mid-20th century and the digital culture of the early 21st. Anyone older than 35 grew up using the same basic communications technology that Franklin Roosevelt did: the telephone, the radio, the pen, the postcard. FDR didn’t have television, true, but TV has always been a one-way street. It’s for entertainment, not for communication, and, at least until recently, it was linear, time-limited.

These analog tools cultivated patience. If you wanted to see what happened to Scully and Mulder in the next episode of “The X-Files,” you had to clear your schedule and get in front of a TV at the appointed time. If you wanted to listen to your favorite artist’s new album, you went to the record store, paid for it and brought it home. If you sent someone a letter, you waited for a reply. The waiting embedded a sense that you can’t have everything you want immediately. Putting cash on the barrel for the movies you watched and the music you listened to reinforced the notion that good things have a price, and you can’t get something for nothing.

So what can Gen X do to help save America? It can begin by reasserting the relevance of the flesh-and- blood world that formed it. On an individual level, this means putting the iPhone down, turning off the computer and taking a book out of the library or visiting a museum. It means talking to your friends face-to-face more instead of mostly texting or emailing them. On a societal level, it means pushing back against those who blithely accept that technology can be the solution to all our social and political problems. It means adopting a healthy skepticism of millennials’ efforts to disrupt every industry with technology and an ethos of “sharing.” It means fighting for your privacy.

If Gen X doesn’t get its act together — and fast — it will have the rug pulled out from under it just as it’s on the verge of realizing its potential. That would be a shame, for a society that desperately needs a counterbalance to the millennial rush to a digital world.

Some say that, in America, everything works out in the end. These optimists put their full faith in the American system — representative democracy, the Constitution, the Bill of Rights, free markets, free minds, liberty and justice for all; or, alternatively, in the arrival of a political Superman to put us back on course. Sometimes, though, no Superman can be found, and an entire generation of Americans must step into the breach. It’s happened before.

Matthew Hennessey is associate op-ed editor at the Wall Street Journal. Encounter Books will publish Hennessey’s book on Gen X and technology in 2018. This article is an excerpt from City Journal.