As the mother cell withers away or gets blasted by all kinds of environmental damage, the spore lies dormant, enduring it all, just waiting for things to get better. Not all bacteria can form spores. But several types that live in the soil can. Their spores are called endospores. The difference between endospores and exospores is mainly in how they form.
Endospores form inside the original bacterial cell, as described above.
Exospores form outside by growing or budding out from one end of the cell. Exospores also don't have all the same building blocks as endospores, but they're similarly durable. Cysts are thick-walled structures that, like spores, protect bacteria from harm, but they're somewhat less durable than endospores and exospores. Bacteria aren't the only microbes that can form protective spores, however. Some protists can, too.