This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

(CNN) — “Modern Family” says goodbye Wednesday night, with the Emmy-winning sitcom’s series finale offering a potential welcome distraction from unsettling current events.

Just as another family comedy, “The Cosby Show,” did almost 30 years ago.

“Modern Family,” the ABC series, will air a final one-hour episode — following a retrospective of the program’s 11-year, 250-episode run — with viewers staying indoors due to the novel coronavirus.

“Cosby” — one of the highest-rated programs of all time — aired its finale amid a more localized event, the outbreak of the Los Angeles riots in the wake of acquittal of police officers charged with the beating of motorist Rodney King.

For Los Angelenos, the scenario of temporarily escaping bad news by watching a long-running comedy has clear parallels.

On April 30, 1992, “The Cosby Show” aired its 201st episode. But the program also included a special message recorded by its star, Bill Cosby, which played on KNBC-TV in Los Angeles, telling viewers, “Let us all pray that everyone from the top of the government down to the people in the streets . . . would all have good sense. And let us pray for a better tomorrow, which starts today.”

Cosby actually taped two messages, one to be broadcast in case the episode didn’t air, amid the violence occurring across the city and a locally imposed curfew.

Longtime KNBC news anchor Jess Marlow introduced the show, noting that then L.A. mayor, Tom Bradley, had urged people to “stay off the streets and watch ‘The Cosby Show.’ We believe we need this time (as) a cooling-off period . . . to remember what our Thursday nights were like before all this madness began.” Marlow closed by saying, “We hope you use this hour to say goodbye and thanks to a good friend.”

In a piece marking the 30th anniversary of the premiere, then-New Orleans Times-Picayune columnist Jarvis DeBerry observed that “The Cosby Show” — held up as an idealized example of America’s racial progress — had collided with a harsher reality.

“I’ve always loved ‘The Cosby Show,'” he wrote. “But it doesn’t escape my attention that a show that gave the impression that black people had overcome went off the air just as black Los Angeles was making a strong case that we had not.”

Obviously, the line from “The Cosby Show” to “Modern Family” only goes so far. And memories of the former can’t be divorced from the association with its imprisoned star, who was convicted of sexual assault in 2018.

Still, both programs brought families together, featuring casts with children that grew up before the audience’s eyes. Where “Cosby” was seen as a unifying force by demonstrating that a show with an African-American cast could appeal to such a broad audience, “Modern Family” broke ground with its depiction of a loving gay couple, whose marriage in a 2014 episode came a year before the Supreme Court’s ruling on gay marriage.

During the retrospective, the stars of “Modern Family” discuss what the show has meant to them. Ty Burell says the series “has sort of ruined me in the best way,” and Julie Bowen, who plays his wife, adds, “If this is my best job, I’ll take it.”

As a commercial hit that shares the record with “Frasier” (five) for the most Emmy wins as outstanding comedy — and the last broadcast series to claim that prize — “Modern Family” doesn’t have any mountains left to climb.

But in terms of taking people’s minds off their daily worries, in much the way “Cosby’s” finale fulfilled that role, the show has one job left to do.

“Modern Family” will air its series finale April 8 at 9 p.m. on ABC, following a one-hour retrospective.