Many discarded explanations were once supported by a scientific consensus, but replaced after more empirical information became available that identified flaws and prompted new theories which better explain the available data.
For example, Newtonian classical mechanics is accurate enough for practical calculations at everyday distances and velocities, and it is still taught in schools.
Malaria was discovered to be a mosquito-borne disease, explaining why avoiding the "bad air" near swamps prevented it.
Increasing ventilation of fresh air, one of the remedies proposed by miasma theory, does remain useful in some circumstances to expel germs spread by airborne transmission, such as SARS-CoV-2.
Some theories, such as Lysenkoism, race science or female hysteria have been generated for political rather than empirical reasons and promoted by force.