Scientific method! Often the result of research supports or forms a theory about what causes a given disease. Then scientists do an experiment. e.g. get two groups of volunteer patients, and given their doctors either the test medicine or a placebo (fake medicine, often just a bland sugar pill). The patients and the doctors don’t know who received what, but the trial organizers do, so they can compare results between the trial medicine and the control group with minimal complicating factors.
Maybe the trial medicine patients have better outcomes than the control group. Maybe they have worse outcomes. Maybe there’s no difference at all. Maybe it’s both at the same time, e.g. headaches go away but their fingernails become wrinkly. This all provides more data to inform future theories.
Often past research supports affecting certain mechanisms or biological targets. So if we know XYZ affects a certain receptor, they can design a molecule similar to XYZ to hopefully bind more or less strongly to said receptor. But you still need to test it because biology is complicated and that might not be the only way things interact with the new molecule. But medicine doesn’t always know exactly WHY something works. Sometimes it just does, but regardless of HOW it works, the scientific method can give strong evidence whether or not it *does* work.
It can get complicated, some thing are toxic in high doses and ineffective at low doses, so determining a treatment that actually works can be difficult. But with time and effort often comes progress.
Latest Answers