I want to start with a bit of historical theory that’s relevant to your question. In the history of medicine and science, we have a term for this phenomenon: “progress narrative.” In essence, it’s very easy to characterize medical and scientific advancement as cumulative and linear, when in fact scientific change is a lot more complicated than that (I won’t belabor this point, but see Kuhn’s seminal work “The Structure of Scientific Revolutions” for a start.) The history of medicine has also been plagued by what we call “great man theory,” or the accreditation of breakthroughs to single individuals without recognizing the collaborative and communal nature of scientific discoveries. Rather than thinking about advancements as a straight, sequential line of events, we should think of it more like the branches of a tree: some branches end when a scientific practice is disproven (like phrenology) while new, related ones backed by new science emerge (psychology and psychiatry, which themselves have changed considerably over time.)
Now, for the second part of your question. There are plenty of effective medical procedures from the past that have fallen out of favor. One very notable one is ECT or electroconvulsive therapy. ECT gained a terrible public image in the USA as an inhumane and traumatic way to treat mental illness, especially in the wake of the film “One Flew Over the Cuckoo’s Nest.” Modern medicine has found ways to use ECT effectively and humanely for patients with mental illness resistant to other treatment: but ECT is still a rather hush-hush practice in contemporary psychiatry because of its bad historical reputation (see Sadowsky’s ECT in America.) Leeches and maggots also have proven medical use for wound care, though they aren’t as commonly applied today. And even homeopathic drugs of the past are in fact useful: there is a longstanding literature on the effectiveness of placebo medications that could corroborate the effects of these medicines in the past.