The part of the body that dies last is the brain.
While the heart may stop beating first, the brain can remain active for a short period after. This is because the brain requires a constant supply of oxygen to function, and when the heart stops, the brain is deprived of this vital resource.
However, the brain cells are incredibly resilient and can survive for a short time without oxygen. This is why doctors can sometimes revive patients who have been clinically dead for a few minutes.
The exact time it takes for the brain to die after the heart stops varies depending on a number of factors, including the person's age, health, and the cause of death.
However, it is generally accepted that the brain cells begin to die within minutes of being deprived of oxygen.
This is why it is so important to perform CPR immediately on someone who is in cardiac arrest. The sooner the heart is restarted, the less damage will be done to the brain.