The type of organisms that take energy by eating up other organisms in an ecosystem are called 'CONSUMERS'. Now these consumers are further divided into three major classes:
1. Primary consumers: this type of consumers feed directly from the producers (plants) and they only eat grass, leaves, vegetables, etc. Such animals are also called herbivores. Example: rabbit
2. Secondary consumers: these are the animals that eat up primary consumers (animals that feed only on plants). These animals are called carnivores. Example: snake
3. Tertiary consumers: animals that eat carnivores which eats a herbivore are called tertiary consumers. They can be completely carnivore or omnivore (who feed on animals and plants both). Example: humans (they feed on animals and plants both)