One example of an ecosystem is a forest. In this ecosystem, a food chain could involve producers such as trees and plants, which are then consumed by herbivores like deer and rabbits, which are in turn consumed by carnivores such as wolves or eagles.
An example of a food chain in a desert ecosystem could be: desert plants (producers) --> kangaroo rat (primary consumer) --> snake (secondary consumer) --> hawk (tertiary consumer).