As far as I can tell, before like 1880 they prescribed mercury for everything.
Even though they were universally terrible, when you read their writings they're no less confident in what they were doing than modern doctors are.
My favorite historical doctor was Benjamin Rush, a "founding father," who was hilariously bad at his job even for the time.
But you are right, generally speaking you had the choice between really bad, utterly had, extremely bad and outright killing theit patients bad doctors for the most part of history.
Medical malpractice is the third-leading cause of death. (After cancers and cardiovascular problems, aka "old age".)
This is inevitable as we can't really experiment on people and do real science.
This is still the case in many communities worldwide, a good pharmacist is a real anchor for providing care for day-to-day health care. It's a great filtering mechanism too, the pharmacist as a buffer for frivolous doctor's visits.
Contrast that to here in the US. When's the last time somebody sought out direct medical care from a pharmacist? Pretty much the kneejerk always is go straight to a doctor, no matter how small the discomfort.