In "The Hitchhiker's Guide to the Galaxy" series by Douglas Adams, a series of comedic science fiction novels, the fate of the Earth is a central plot point. In the story, the Earth is actually destroyed in the very beginning. Here's a brief summary of what happens:
In the first book, "The Hitchhiker's Guide to the Galaxy," the protagonist Arthur Dent narrowly escapes the Earth's destruction. Unbeknownst to Arthur, Earth is scheduled for demolition to make way for a hyperspace bypass. The destruction is carried out by a Vogon construction fleet to make room for a galactic highway. Arthur is saved by his alien friend Ford Prefect, who turns out to be an undercover researcher for the titular guidebook.
The Earth's demolition is depicted as a sudden and absurd event, highlighting the book's humor and satire. The destruction occurs in a matter of moments, leaving Arthur as one of the few surviving humans. The reasons behind the Earth's destruction and the absurdity of the situation serve as a starting point for the adventures and misadventures that follow in the series.
It's worth noting that "The Hitchhiker's Guide to the Galaxy" is primarily a work of fiction, and the events surrounding the Earth's destruction are a fictional creation for the purpose of the story's humor and narrative.