Before the age of modern epidemiology, attempts to control the outbreak of a contagious disease included an arbitrary forty days of enforced confinement.
New and strange diseases were often carried from abroad by ships, so a quarantine of crew and cargo helped discourage epidemics.
Forty days was chosen because of its prominence in the Bible.
The word “quarante” is the French word for forty, and quarantine literally translates to “forty-ish.”