When 20-year-old actor Cameron Boyce died last weekend in his sleep from what his family said was a seizure, it made many people wonder how common this is and how can it be prevented.

The actor was known for the "Grown Ups" and "Descendants" movies as well as the "Jessie" series.

Dying after a seizure is often called sudden unexpected death in epilepsy, or SUDEP. Like the infant disease sudden infant death syndrome, we're not sure exactly what happens in people with SUDEP, says Dr. Katherine Labiner, a pediatric neurologist and epileptologist at Child Neurology Consultants of Austin.

It's believed to be related to their body's ability to get oxygen after a prolonged seizure or a heart arrhythmia, she says. It could be that the person has a seizure and is smothered to death when their face falls into a mattress or pillow. They can't control their body enough to turn their head to get air. Or they could vomit or have excessive drool and then breathe that back in.

SUDEP is more common in adults than children, Labiner says. She cites the rates of SUDEP as about 1 in 1,000 adults with epilepsy and 1 in 4,500 kids with epilepsy, but it's more common in people in their late teens and early 20s. The reason: This is a population of people that might not be as compliant with the medications or regularly see their doctor to be monitored. Drugs and alcohol also can be a factor.

Labiner talks to her patients and parents about the importance of regular follow-ups with their specialists, taking medications regularly and not drinking or using drugs.

Doing regular monitoring of their seizures with something like an electroencephalogram — EEG — either at home or in the hospital can help tell what kind of seizure they are having, if medications are having an effect and whether their heart rate or oxygen level is affected during their seizures.

RELATED: Kids with seizures can now do testing at home with portable EEG

If a patient seems to be at risk for SUDEP, Labiner will recommend using a monitor such as one that is in a smartwatch that can alert a family member by text of a seizure event, or a bed monitor that detects movements, or a video baby monitor for the family to hear or see a seizure.

RELATED: Austin family puts Smartwatch to detect seizures to the test

Even though more is not known about what causes SUDEP and how to prevent it, Labiner says she talks to families about the best ways to prevent it and what the risks are. Risks also include having more seizures at night, or not responding well to medication. That's also why it's important to follow up with a doctor about your medication and symptoms and whether you are sleeping OK or waking up tired (which could mean you're having seizures without realizing it).

More research is being done, and doctors around the world submit their patients' data to international databases to help figure out what is going on, Labiner says.

RELATED: 11-year-old starts foundation to educate about epilepsy