Pneumonia is a lung infection that’s caused by a buildup of fluid or mucus. These buildups reduce the effectiveness of your alveoli, which are tiny air sacs that move oxygen from the air you breathe into your blood.

Pneumonia isn’t contagious, but it can be caused by a number of things — some of which might be contagious. These include:

  • viruses
  • bacteria
  • fungus
  • progressive lung diseases
  • asthma
  • smoking
  • use of a ventilator
  • other upper respiratory infections

Aspiration pneumonia is a specific type of pneumonia that develops when you inhale food, stomach acid, or saliva into your lungs.

Read on to learn more about five ways to protect yourself from pneumonia.

Getting the pneumonia vaccine reduces, but doesn’t eliminate, your risk of getting pneumonia. There are two types of pneumonia vaccines:

  • pneumococcal conjugate vaccine (PCV13 or Prevnar 13)
  • pneumococcal polysaccharide vaccine (PPSV23 or Pneumovax 23)

Pneumococcal conjugate vaccine

The pneumococcal conjugate vaccine (PCV13) protects against 13 kinds of bacteria that cause serious infections in children and adults.

PCV13 is part of the standard vaccination protocol for babies and is administered by a pediatrician. In babies, it’s given as a three- or four-dose series, beginning when they’re 2 months old. The final dose is given to babies by 15 months.

In adults aged 65 and older, PCV13 is given as a one-time injection. Your doctor may recommend revaccination in 5 to 10 years. People of any age who have risk factors, such as a weakened immune system, should also get this vaccine.

Pneumococcal polysaccharide vaccine

Pneumococcal polysaccharide vaccine (PPSV23) is a one-dose vaccine that protects against 23 kinds of bacteria.

It’s not recommended for children. PPSV23 is administered to adults over age 65 who’ve already received the PCV13 vaccine. It’s usually given about 1 year later.

People ages 19 to 64 who smoke or have conditions that increase their risk for pneumonia should also get this vaccine. People who receive PPSV23 at age 65 generally don’t require revaccination at a later date.

Potential side effects of the pneumonia vaccines

Both pneumonia vaccines may have some side effects. These may include:

  • redness or swelling at the injection site
  • muscle aches
  • fever
  • chills

Children should not get the pneumonia vaccine and the flu vaccine at the same time. This may increase their risk of having fever-related seizures.

Although pneumonia itself isn’t contagious, it can be caused by a variety of infectious organisms like viruses, bacteria, and fungi. Washing your hands is the best way to avoid transferring these organisms into your respiratory system.

When washing your hands, be sure to clean them thoroughly using the following steps:

  • Wet your hands with clean — preferably running — water.
  • Apply enough soap to cover all surfaces of your hands and wrists.
  • Lather and rub your hands together briskly and thoroughly. Make sure to scrub all surfaces of your hands, fingertips, fingernails, and wrists.
  • Scrub your hands and wrists for at least 20 seconds.
  • Rinse your hands and wrists under clean — preferably running — water.
  • Dry your hands and wrists with a clean towel, or let them air-dry.
  • Use a towel to turn off the faucet.

If you don’t have access to soap an water, you can also clean your hands with an alcohol-based hand sanitizer.

Most respiratory infections are spread through tiny particles in the air or on the surfaces we touch. Avoiding contact with people that you know are sick is an important step in preventing respiratory infections and possible pneumonia.

If you’re in a crowded area or can’t avoid being near people who are sick, be sure to:

  • wash your hands frequently
  • cover your mouth and nose with a mask to prevent flu, cold, and COVID-19
  • encourage others to cover their cough or sneeze
  • avoid sharing personal items

How you care for your body and the environment around you plays a big role in your body’s ability to resist infections that can lead to pneumonia.

The following actions can help you strengthen your lungs and your immune system:

  • getting enough rest
  • eating a balanced diet
  • exercising regularly
  • avoiding smoking
  • reducing your exposure to harmful chemicals or pollution
  • staying up-to-date on your vaccinations

If you already have a cold, talk with your doctor about proactive steps you can take to prevent it from turning into pneumonia.

Recommendations include:

  • making sure to get enough rest while recovering from a cold or other illness
  • drinking lots of fluids to help eliminate congestion
  • taking supplements like vitamin C and zinc to help boost your immune system

Avoiding postoperative pneumonia

If you’ve recently had surgery, talk with your doctor about what you can do to avoid postoperative pneumonia. They may suggest:

  • deep breathing and coughing exercises
  • keeping your hands clean
  • keeping your head elevated
  • oral hygiene, which includes an antiseptic such as chlorhexidine
  • sitting as much as possible, and walking as soon as you’re able

How your pneumonia is treated will depend on what type you have and how severe your pneumonia is. Pneumonia can affect just one section — or lobe — of your lungs, or every space of both lungs.

If your pneumonia was caused by a bacterial infection, or fluids that collect after aspiration become infected, antibiotics may be prescribed to you. Fungal pneumonias can also be treated with antifungal medications.

When your pneumonia is caused by a virus, antibiotics and antifungals won’t help. For some viruses, like influenza, an antiviral medication may be used. Otherwise, supportive care — maybe even in a hospital — is the best way to treat viral pneumonia.

Severe cases of pneumonia — regardless of what caused it — may require treatment with more intense therapies like supplemental oxygen, breathing treatments, or even mechanical ventilation.

If you have pneumonia caused by a bacterial infection, your doctor will prescribe antibiotics for you to take. You may also need breathing treatments or oxygen depending on your symptoms. Your doctor will decide based on your symptoms.

You may also benefit from taking cough medicine if your cough is interfering with your ability to rest. However, coughing is important for helping your body eliminate phlegm from the lungs.

Taking care of your overall health can help, too. Rest, drink lots of fluids, eat nutritious foods, and give your body time to heal. Remember, if can take a month or more to fully recover from pneumonia.

Pneumonia is a potentially serious complication of upper respiratory infection spreading to the lungs.

It can be caused by a variety of germs, including viruses and bacteria. Babies under 2 and adults over 65 are recommended to get the pneumonia vaccine. Individuals of any age who are at increased risk should also get the vaccine.

Healthy habits and good hygiene may also reduce your risk of getting pneumonia.