Although lots of things don’t preserve well as fossils, it turns out that we can reconstruct most parts of ecosystems pretty well. The terrestrial plant record is well preserved as pollen grains. The base of food chains has a good record in calcareous algae and diatoms. Fossil zooplankton (that eat the algae or other protists) are represented by the foraminifera and ostracodes as well as many other microfossils. And fish have an amazing, but mostly unstudied record of fish teeth and shark scales.