Bacteria are very small, so they cannot move very far on their own. Viruses cannot move themselves at all. So how does a specific type of bacteria or virus spread from a small place to a very large area (such as the whole Earth)?
Birds migrate for thousands of miles, carrying diseases on a time scale of months or less. With climate shifts, insects and animals shift their ranges on a time scale of hundreds of years or more. Bacterial spores like anthrax can be in a form that is easily blown around the whole Earth, ready to thrive wherever they touch down. Plant diseases travel with their plant hosts, and over time scales of thousands of years the plants - e.g., dandelions and conifers - can spread thousands of miles of latitude and longitude.
The answer by @SMcGrew is essentially correct, but let me add a technical term (at least in the context of infectious diseases): the bacteria and viruses a carried by vectors. Since word vector is a kind of overused, even if we limit ourselves to biology, it is also common to be more specific and call the disease vectors.
Vectors are classified into biological vectors and mechanical vectors, depending on whether they biologically interact with the microbe (i.e., they get infected) or whether they are simply carried from one place to another.