When an antibiotic works, the relief it brings is typically fast and resolute.

But if you have ever taken an antibiotic for a viral infection or stopped taking your medicine because you felt better, you’ve not only lessened the likelihood of a complete recovery but also have put yourself at an increased risk of a potentially deadly antibiotic-resistant infection, health experts say.

Every year, more than 2 million people in the United States become ill with an antibiotic-resistant infection, according to a Centers for Disease Control and Prevention (CDC) report released last year. Of those, more than 23,000 ultimately die. These figures are conservative estimates, the CDC says; the actual numbers are likely higher.

Since their discovery in the early 20th century, antibiotics such as penicillin have been the stars of modern medicine. However, in recent months, researchers, medical experts and even the White House have warned against their overuse. Their popularity is partly to blame for the growing problem of antibiotic-resistant infections, and there is a widespread effort to educate you, the patient, about the dangers of too much medicine.

READ MORE: Are you paying too much for prescriptions?

U.S. hospitals overuse antibiotics, study finds

“We have to protect patients by protecting antibiotics,” CDC Director Tom Frieden told the Wall Street Journal. “The drugs we have today are endangered, and any new drugs could be lost just as quickly.”

A recent study published in the journal Infection Control and Hospital Epidemiology found that U.S. hospitals are overprescribing antibiotics at alarming rates. The researchers reported “inappropriate” and “redundant” antibiotic use in 78% percent of the 505 hospitals they observed between 2008 and 2011, putting patients at increased risk of harm.  The price of this unnecessary antibiotic use is financial as well, resulting in more than $12 million in avoidable health care costs.

READ MORE: How medical bills affect your credit

So where did we go wrong with antibiotics? Perhaps we underestimated nature’s power to evolve. Bacteria, normally killed by antibiotics, change to withstand the onslaught of the drugs, so fast, in fact, that the medical industry can’t keep up.

Clostridium difficile is just one such resistant infection moving through hospitals across the country, often leading to sepsis and even death. The CDC says reducing antibiotic use by 30% could reduce the number of C. difficile infections alone by 26%.

What patients need to know

For health care consumers, understanding how antibiotics work, and more importantly, how they don’t work, could help reduce the spread of antibiotic-resistant infections and unnecessary medical costs. But despite the increased attention in recent months and years, many Americans remain uninformed.

“The vast majority of patients I have treated in recent years are unaware of any recent studies or the consequences of antibiotic overuse,” Dr. Arta Bakshandeh, senior medical officer with Alignment Healthcare, tells NerdWallet. “It is not until they meet me in the hospital with a drug-resistant infection that they begin to realize how harmful overuse can really be.”

READ MORE: How to negotiate your costly hospital bills

Some patients expect a prescription for antibiotics, no matter the diagnosis. But antibiotics only kill bacterial infections, not viruses that cause the common cold, the flu or even bronchitis. Taking an antibiotic for illnesses like these doesn’t help you recover. In fact, it can cause long-term harm by creating an environment susceptible to infections from antibiotic-resistant bacteria.

Bakshandeh says some doctors are reluctant to refuse to prescribe an antibiotic, even when they know such a drug won’t help, because they don’t want to lose their business. That hesitance is a consequence, he says, of the “fee for service” system.

READ MORE: What does Obamacare mean for your 2014 taxes?

He recommends that patients come to their doctor prepared with a list of questions and a willingness to learn. If your doctor prescribes an antibiotic, ask why and make sure you understand the dosage amounts and duration. “It’s important to take your antibiotics as directed even if you feel better,” says Bakshandeh, because failing to finish your prescription could increase your risk of developing a stronger, resistant infection.

Knowing when antibiotics are appropriate is the responsibility of both doctors and patients. Under ideal conditions, antibiotics can save lives. But in the case of antibiotic resistance, it can be too much of a good thing.

Elizabeth Renter writes forNerdWallet Health, a website that helps people reduce their medical bills.