Who discovered a way to prevent infection after surgery?
Ignaz Semmelweis and Joseph Lister were significant figures
Since the middles ages, some physicians and surgeons had been using things like wine and ethanol to clean wounds, which prevented infection even though they didn't know why, but the first informed used of antiseptics is usually thought of as Joseph Lister and carbolic acid.
Lister had been shown some of Louis Pasteur's work on germ theory and theorised that wounds got infected because the microbes in the air entered the body through the wound. He wanted to find a "chemical barrier". A friend of his told him about carbolic acid, which was being used for sewage treatment. It helped to reduce the smell by killing the microbes that were causing decay.
Joseph Lister first tested his carbolic acid on a boy (James Greenlees) that had been run over by a cart and badly fractured his leg in 1865. Instead of amputating the leg (the previous solution), Lister set the bone and bandaged it in dressings soaked in carbolic acid. James complained of irritation, and infection was suspected, but it turned out that the irritation was just due to the acid and the leg was actually healing safely. Lister went on to use carbolic acid in many more of his surgeries, and he published his findings in 1867.
Lister also got the doctors under him to soak everything in carbolic acid and published his guidelines for other surgeons to use, but many surgeons refused to use carbolic acid as it was time-consuming and irritated their skin.
Arguably, and earlier pioneer in infection prevention can be seen in Ignaz Semmelweis who was head of the midwifery department at the Vienna General Hospital. He noticed in the 1840s that a lot of women were dying of "childbed fever" after giving birth. He then linked this to students and doctors coming straight from the morgue, where they had been dissecting dead bodies, to delivering the babies without washing their hands. When his colleague died of a condition very similar to childbed fever after cutting himself whilst dissecting a body, he decided to enforce strict handwashing for all staff. Death rates dropped dramatically as a consequence. However, once Semmelweis left the hospital, the staff stopped washing their hands and death rates rose again.