"Nationalism" in the is sense I mean it is, society should encourage people to see their their fellow citizens the same way people in tribal societies see clan members.

Kinship-based clans and tribes are the natural organizations of society—the system that prevailed in prehistory and still prevails in many places today. Problem is, it's not a good system to build a modern internet industrial civilization on top of; leads to corruption and civil war when applied on a too large scale. So you need to replace clan systems, with something that both works at larger scale and reuses the same human instincts that make clans work.

First, you have to ensure no kinship clans can form. To do this society (government, media, organized religion) encourage the nuclear family–exclusive marriage between one man and one woman, who are not close blood relations. Ideally, a significant percentage of these marriages should be between people of different backgrounds—different race, or socioeconomic status, or geographical region, etc). These marital norms are ideal for preventing clans from forming; it's no coincidence that the societies which stick to them the most are the generally the most functional. (For more see "The WEIRDest People in the World" by Joseph Heinrich)

Next, you need to implement nationalism to replace the kinship structures you have systematically destroyed. A nation is an "imagined community"; a group of people who aren't actually family relations, not part of a kiship-based tribe, but it sort of feels like they are, you play on the same instincts.

First, a nation needs territory, with a defined border.

Second, you need a citizenship system; either one is a member of the imagined community, or one is not.

Third, you need a common heritage, so that perfect strangers believe they have something in common. That way you can play on the same instincts that make kinship tribes work, depite the lack of actual kinship.

You'll want a shared history, taught in schools, that provodes an origin story for the nation, and the story has to be postitive and unifying. (For example, in USA, "Founding Fathers," "first Thanksgiving," and "conceived in liberty", not "1619 Project" and "Columbus Day is evil.") Unifying themes should continue throughout the rest of your shared historical narrative. (For example, when dealing with the US Civil War, the narrative should be "we should celebrate that the Union won, preserving the nation and freeing the slaves. But the Confederate soldiers were Americans fighting bravely for their countrymen too, we should honor their memory even as we vow never to repeat their mistake.") None of this means you have to lie about historical facts! History is narrative as much as it is empirical fact, and you can make many choices in the former without betraying the latter.

You will also want a shared literary and artistic culture—classic books, songs, movies, etc everyone knows. You will want a flag, an anthem, a pledge of alleigance, and all that jazz. Shared foods, shared holidays. Ideally a shared language. A dominant religious tradition, if possible (don't infringe on people's freedoms just to try to get this!).

You want good social mobility, you want people of diverse perspectives to mix. "I'm no different than that successful well-off person, with talent hard work and just a bit of luck I can end up just like them." "I'm blessed to have grown up in this community and to have had all these opportunities, but I have friends/family from a different background who aren't so lucky, so when I meet someone who thinks differently than I do, I can understand."

Note: ensuring social mobility does not mean you discriminate based on arbitrary characteristics, like ethnicity or skin color! That destroys national unity. It also doesn't mean you don't enforce immigration laws. Once one is a citizen of the nation one is equal in rights to all the other citizens, but there is no right to join the imagined community if one is not yet a member.

You want low crime, and a fair and effective justice system with rule of law. Citizens should be able to trust each other.

Finally, ideally you want democracy! By participating in the government of the nation, citizens will feel true responsibility, ownership, and belonging. "Of the people, by the people, for the people" makes "the people" real. Elections must not only be free and fair; it should be blindingly obvious that they are so. "Obviously no deficiencies," not "no obvious deficiencies," to quote Tony Hoare. And beyond elections, citizens of all backgrounds and political persuasions must be able to freely debate and discuss the issues.

(Wow this came out really long, sorry)