Producers are the green plants which produces energy by the process of photosynthesis. It forms the lowest layer of biological pyramid. For example, plants.
Primary consumers are the consumers which depends on the producer for energy. For example, herbivores like cows.
Secondary consumers are the consumers which depends on the primary consumers for energy. For example, carnivores like lion.
Decomposers are the organism which obtain energy by degradation of dead and decomposed organic matter. For example, saprophytic fungi.