Years ago, people hadn't perfected the skill of deciding whether or not a person was dead. It might seem fairly obvious, but today, the pathologist or family Doctor is expert at conducting tests to ensure they are dealing with a deceased person and not someone who has fallen into a coma or is unconscious with a hardly discernible heartbeat.
But in the early Victorian period the fear of being buried alive was real...everyone had a tale to tell about a neighbour in the next street who had been found to have left deep gouges in the lid of their coffin because they'd woken up once the mourners had gone home and the earth was neatly piled on top of them...quite how they found out about the frantic scratching to escape I really don't know.
These stories spread of course, and it became customary to leave the nails out of the coffin lid until a respectable amount of time had passed then you'd have been dug up again and checked...still dead? Then the nails were hammered firmly into place and you were returned to the earth.
Some didn't trust the open coffin lid...they had a bell on a long string attached to a stout pole outside their coffin...they could then alert the night-watchman to their plight and he could send for help to enable to person to escape...
Another device was a kind of ear trumpet...the sort used by people who were hard of hearing before the advent of hearing aids. That was put in the coffin with you so you could blow on it and make enough of a noise to get the poor night-watchman running to your aid...
Quite bad enough to be frightened of burial alive...but you might also have had to contend with those who practised the Black Arts and decided your body was just right for their secretive ceremonies held in the dead of the night. The Black Arts were very popular with the Victorians...they loved séances and calling up spirits and so on and some of the more enthusiastic took it to the next level in trying to raise Lucifer himself.
If they didn't get you, the body snatchers might have done. Once the Penal Laws reformed, and fewer people were hanged, it meant a shortage of fresh cadavers for would be surgeons to dissect...recent burials were ideal.
I'd not worry too much if I were doesn't happen very often nowadays.