Palynology is the study of pollen, or, more specifically, “the study of microscopic objects of macromolecular organic composition (i.e. compounds of carbon, hydrogen, nitrogen and oxygen), not capable of dissolution in hydrochloric or hydrofluoric acids.” This includes pollen and spores, among other things.
Pollen is extremely resilient, and scientists can extract ancient pollen from compacted earth or lake beds, and analyze the composition, to see what plants existed during a certain time period.
Source: W.A.S. Sarjeant, 2002. ‘As chimney-sweeps, come to dust’: a history of palynology to 1970.