Safety coffins were a big thing in the 1800’s. The fear of premature burial was not entirely without merit. The wiki link mentions that during the cholera epidemic, they didn’t put a very fine point on the difference between “dead”, and “not dead, but we think you will be pretty soon.” Poe has entered the chat.
There was even a London Association for the Prevention of Premature Burial, who agitated for requiring a physician examination before someone was declared dead.
Lots of these contraptions were made, often with bell mechanisms and fresh air tubes for the prematurely interred.

The rise of cremation and embalming more or less ended the risk of premature burial.


EDIT: apparently this is all wrong. “Ringer” was a term for a substitute in a horse race or a fight, and “dead” was used in the sense of “precise” or “exact” like “dead eye.”
Fun fact: we get the term “dead ringer” from the practice of attaching a bell string to a cadaver’s finger and mounting the bell above their grave, so if someone was buried alive they could ring the bell and be disinterred.
Apparently there’s another folklore, also false, that “saved by the bell” referred to this practice. It’s boxing related, which is more plausible, but less fun.