Quarantine was the main method of prevention of the black plague in Venice, and the lazzaretti served that purpose.
Bad air was believed to be a major cause of sickness in the past, based on Aristotle’s idea of miasma as the cause of disease.