Microorganisms have important roles in the ecosystem, such as decomposing dead organic matter, fixing nitrogen, producing oxygen through photosynthesis, cycling nutrients, and serving as a food source for other organisms. They are also used in biotechnology and can be indicators of environmental health.