Whoopi Goldberg announces near-death battle with pneumonia, sepsis: What you should know Combined, the two illnesses are potentially deadly.

Whoopi Goldberg announced on Friday that she had been absent from co-hosting “The View” because she had been dealing with pneumonia and sepsis, saying that the two illnesses nearly killed her.

“I am here. I am up and moving around. Not as fast as I’d like to be, but I am OK. I’m not dead,” Goldberg, who last appeared on “The View” on Feb. 5, said in a message recorded for the show. “I came very, very close to leaving the Earth. Good news: I didn’t.”

Pneumonia and sepsis are two illnesses that can get pretty serious. Here’s what you should know about them.

Pneumonia is an infection of the lungs that ranges in severity.

In the United States, pneumonia is the most common cause of hospital admission aside from women delivering children. In 2013, pneumonia was responsible for 960,000 hospital stays and nearly 60,000 deaths that year. The illness is now the eighth leading cause of death.

The severity of the lung infection depends on what’s causing it and who is affected by it. Pneumonia can be caused by a wide variety of bacteria, fungi or viruses, which enter the lungs from the air we breathe. A single organism can account for as many as 10 percent of cases, the most common being a bacteria called Streptococcus pneumoniae. Influenza, also known simply as the flu, has the potential to cause pneumonia, too.

A weaker immune system raises the risk of getting a serious case of pneumonia. At-risk groups are considered to those who are young, such as children, the elderly and those who have compromised immune systems.

Symptoms of pneumonia include fever, shortness of breath and cough. Doctors who suspect their patients have pneumonia will often order blood tests and a chest X-ray to look for other signs of infection. However, not all pneumonias require hospitalization. Mild pneumonias can be treated in as little as five days with antibiotics.

Doctors may ask patients to stay in the hospital for closer monitoring in cases where pneumonia doesn’t improve or where it began as severe.

Survival from pneumonia has improved significantly over time. But death rates still range from as low as 3 percent in those who are treated outside of the hospital to 50 percent in those who require care in a hospital’s intensive care unit. For some people with pneumonia, recovery can take up to six to eight weeks.

Complications from pneumonia can make it a much more serious problem.

There are several complications that can make pneumonia a bigger problem. Pleural effusion, which is sometimes called “water in the lungs,” occurs when fluid accumulates just outside the area of the lung where the infection is located. The fluid can sometimes turn into pus, too. If it doesn’t improve on its own or with antibiotics, the fluid may have to be drained with a needle in a bedside procedure called thoracentesis.

Severe pneumonia and pleural effusions may block the transfer of oxygen from the air we breathe into our blood. When respiratory failure like this develops, doctors will likely have to intubate the patient, which requires placing a breathing tube down their throat and connecting it to a breathing machine. This allows doctors to control the patient’s breathing.

Sepsis is severe complication of pneumonia that worsens a patient’s outlook.

Sepsis is preceded by a condition known as bacteremia, which occurs when the organisms that cause pneumonia spread into the blood. People who develop bacteremia should go to a hospital immediately to receive intravenous antibiotics. If the bacteremia worsens to the point where vital signs are affected — blood pressure drops, heart rate goes up, breathing rate increases, fevers rise and blood oxygen levels drop — then they’re considered to have sepsis.

It’s worth noting that sepsis can develop from any kind of infection, not just pneumonia. However, pneumonia is the leading cause of sepsis. It’s a big deal because sepsis is more likely to lead to a worse outcome; mortality rates from sepsis can be as high as 15 percent.

There are steps you can take to prevent pneumonia.

Because the elderly are especially vulnerable to pneumonia, it’s recommended that everyone receive pneumonia vaccinations at the age of 65. There are two types of pneumonia vaccines — Pneumovax and Prevnar. Each contains bits of different strains of bacteria that cause pneumonia, allowing the body to develop antibodies and therefore immunity to fend off any future infection. Studies show that 69 percent of elderly people who are eligible to receive the vaccine don’t. Other at-risk groups should get vaccinated even earlier, including smokers, diabetics, alcoholics and people with compromised immune systems.

Other preventive measures people could take include receiving an annual flu vaccine and quitting smoking.

In high-risk people, pneumonia can develop into something serious and potentially fatal. But more commonly, it is easily treatable and patients’ outlooks are good. Talk to your doctor to make sure you are up to date with your pneumonia vaccinations if you are part of an at-risk group or over the age of 65.

Dr. Leila Haghighat is an internal medicine resident at Yale New Haven Hospital and a member of the ABC News Medical Unit.