A sarcophagus is named for what people once believed it did to a body.
The word is Greek: sarx, "flesh," plus phagein, "to eat." Etymonline says sarkophagos was first an adjective used with lithos, "stone," so the original phrase meant a flesh-eating stone. It was a kind of limestone that the ancients used for coffins.
The stone was quarried near Assos, a city in the Troad in what is now Turkey. That is why Latin called it lapis Assius, the Assian stone. Etymonline says it was believed to decompose bodies quickly.
There is no sign the stone actually did this. The name records a belief, not a fact.
English borrowed the word from Latin around 1600, and for a while it meant only the stone. Etymonline dates the familiar sense, a stone coffin that is often carved or inscribed, to 1705. The usual plural is sarcophagi, per Merriam-Webster.
Meanwhile the idea spread in another direction. Etymonline says Vulgar Latin shortened the word to sarcus. That form is the source of French cercueil, German Sarg and Dutch zerk, all words for a coffin or gravestone. So the "flesh-eater" survives in everyday European words for a coffin, usually with its Greek meaning forgotten.
The word is also a distant relative of sarcasm. Etymonline says sarcasm shares the sarx root. It comes from Greek sarkazein, "to speak bitterly," literally "to tear off flesh," and entered English in the 1570s.
The second half of the word has a family too. Etymonline traces phagein, "to eat," to a Proto-Indo-European root meaning "to divide, allot." Merriam-Webster dates the English word to 1619, which agrees with the "around 1600" that Etymonline gives for the stone sense.