Here is what a proffesionalprofessional actor says in an answer to a related question on Quora:
I am an accomplished actor and have had to do scenes where I have died, the first thing to do is to prepare for the shot, the director will tell just how long the camera will be focused on you. Before the shot you will be taken to the Make-upmakeup department to be made up to look like youryou are dead if this to be a scene that you are in a coffin at a funeral.
As inan example when I did an episode of a murder show on ID Discovery and played a murdered victim where the camera would be focused on me for a period of time, when the director was ready for the shot Hehe would ask for a hand signal when I was ready in which I would take a deep breadth and then hold it and hold my position the. The director would the take the shot and film for about 40 to 45 seconds and then cut. In some cases the editor can also cheat a shot using a still image of you in position and your still image is matted into the scene where other actors are moving but you are not because your footage that was shot was now placed into the scene as a still shot.
Another thing the is done with some actors when their death involves the eyes to be opened and since you are not really dead your eyes will sometimes blink while some actoractors can hold this for a few seconds, what’s done then is that the rest of the shot is live but the editor creates a still of only your face and then mattsmattes it back on to your face as a layer. There are many things that can be done in post production to accomplish this effect to make it look as real as possible.