Energy is captured from the sun by plants and is passed through ecosystems. Energy collected by the sun by plants is consumed by animals (which can be consumed by other animals) and used for metabolism, growth and reproduction. Plant and animal waste and biomass created from this energy is broken down by decomposers into constituent parts, which can be used by plants to create more tissues. In this manner, ecosystems are cycles and, aside from the addition of sunlight and water, can be self-sustaining.
Place fertile soil in a container (e.g., bucket, aquarium or box). You may need to augment the soil with fertilizers to assure there are enough nutrients to promote plant growth but this usually is not necessary. Natural soil will also contain the microscopic organisms necessary for decomposition such as fungi, bacteria and even microscopic worms. However, you can add larger earthworms to enhance the quality of the soil and increase decomposer biomass.
Plant plants in the soil. Begin either with seeds or full-grown plants. Soak the plants with water and place the container in the sunlight or another suitable light source (one that includes the entire visible light spectrum). Every day or two check the soil moisture making sure that it is damp (not dry or soaking wet). This is especially important if you have the container in the direct sunlight. If the plants seem to dry too quickly or the leaves are burning they may be getting too much sun. Adjust the light levels accordingly.
Add plant-eating animals (i.e., herbivores) such as grasshoppers, pill bugs, aphids, millipedes and snails or slugs to your self-sustaining ecosystem. You can add one or a few species of these consumers. Observe the ecosystem daily to make sure the consumers are not eating the plant matter more quickly than it is being generated. If you notice the plants being stripped bare, remove some of the herbivores until the plant matter regenerates.
You can create other self-sustaining ecosystems including those in water. Include a producer (i.e., algae), a consumer (e.g., water flea) and a decomposer (e.g., protozoans) and plenty of sunlight.