In the fight against germs, we take hand washing for granted. But it wasn’t always so obvious. Back in 1846, when doctors didn’t understand germs, a young Hungarian doctor names Ignaz Semmelweis risked his reputation to try to convince doctors to wash their hands.

Semmelweis was in charge of the maternity ward at Vienna General Hospital, where there were two delivery rooms — one staffed by midwives and the other by doctors and medical students. In the doctor’s ward, more than 12 percent of the mothers died from “childbirth fever,” compared to only 4 percent in the midwives’ ward.

Related: 5 Healthy Hygiene Habits Your Child Needs to Learn

The young doctor set out to discover why. He decided it was because the doctors often went straight from conducting autopsies to delivering a baby without washing their hands. He figured that “cadaver parts” on the doctors’ hands were somehow spreading disease to the women during childbirth. His solution: Convince the doctors to wash their hands and instruments in a chlorine solution. It worked like a charm. Within two years maternal deaths from childbed fever plummeted to about 1 percent.

Today, we know how important hand washing is to preventing the spread of illness. And the process is pretty simple: Wet, lather, scrub, rinse and dry. But still, there are some misconceptions about how and when to wash our hands.

Here are the basics, courtesy of experts at Vanderbilt University, Mayo Clinic and the Centers for Disease Control and Prevention (CDC).

Use cold or lukewarm water

Surprise: You don’t need to use hot water to wash your hands! In fact, it’s wasteful. Researchers at Vanderbilt University found washing with hot water killed no more germs than washing with cold . If the water were hot enough to kill bacteria, it would be too hot to tolerate. Plus, they argue, hot water can irritate the protective layer of skin, making it less resistant to bacteria.

Washing with hot water is bad for the environment. The Vanderbilt researchers estimate that washing our hands with hot water generates 6 million metric tons of carbon dioxide emissions in the U.S. each year — more greenhouse gas emissions than the entire country of El Salvador and about the same as 1.2 million passenger vehicles.

Plain old soap will do the trick

While soap is necessary, anti-bacterial soap is not. Studies show it is no more effective than regular hand soap, and some researchers worry that it will lead to the development of drug-resistant bacteria, making it harder to fight germs in the future, according to the Mayo Clinic.

Related: How to Avoid a Cold: A Virus Expert Reveals What Really Works

“Happy birthday to you”

Make sure you scrub thoroughly, including the backs of your hands, wrists, between your fingers and under your fingernails, for at least 20 seconds, according to the CDC. To encourage kids to wash for a full 20 seconds, teach them to sing the happy birthday song twice while washing.

Hand sanitizers work in a pinch

Alcohol-based hand sanitizers (gels or wipes) are a good option if you don’t have access to clean water or soap. But they don’t kill all germs and are less effective if your hands are visibly dirty or greasy. The CDC recommends a hand sanitizer that contains at least 60 percent alcohol to maximize germ-killing power. But if you have kids, supervise them, and buy unscented hand sanitizer (kids have been known drink, and get sick from, the scented varieties).

Related: Hand Dryers Spew Bacteria, But Should You Worry?

Wash often, wash well

We all know to wash our hands after we use the toilet and before we eat or prepare food. Here are some other times your hands need a washing:

  • Before and after caring for someone who is sick or visiting someone in the hospital
  • Before and after treating a cut or wound
  • After changing diapers or helping a child use the toilet
  • After blowing your nose, coughing, or sneezing
  • After touching an animal, its food or its waste
  • After touching garbage

It’s impossible to keep your hands germs-free all day, but frequent and thorough washing can protect you and your loved ones from bacteria, viruses and illness. Semmelweis would be proud.

Mary Purcell is a freelance writer and health researcher in Piedmont, Calif., with expertise in policy analysis. She has a master's degree in Latin American studies from Georgetown University.