Back in the days of black plagues and other scourges that sent so many souls into their graves, many people had the fear of being buried alive. While they were deep in comatose states, unconscious to the world, the good doctors sometimes ruled someone as no longer living when in fact they were. There was a real fear that people had of being covered with the earth, six feet deep in the dark, dark, darkness of the earth, when in fact they were still alive.
So real was this fear, the terrible fear of premature burial led to the invention of safety devices which could be built into coffins so that those poor unfortunates could notify those passing by that they were not actually dead, and they needed to be released from their graves. The most popular invention was a cord attached to a bell that could be rigged so that the ‘deceased’ could ring it so that people passing by would hear it and take action to rescue the trapped. (The term ‘dead ringer’ comes from this)
Sometimes tools were included in the casket so that the presumed dead could free themselves, although I’m not sure how they were supposed to use them within the tight confines of a coffin. As far as I’ve heard, or haven’t heard as the case may be, there is no record of anyone being saved from premature burial by using these methods, although there have been cases where people have been classified as dead by the wonders of medical school only to show movement and recover.