Do you mean:
* What is a particular role in an ecosystem, and how do organisms make their living? This is a general question about ecological roles and how organisms obtain resources.
* What is the role of [specific organism] in an ecosystem, and how does it make its living? This would be a specific question about one particular organism.
For example, you could ask:
* What is the role of a wolf in a forest ecosystem, and how does it make its living?
* What is the role of a dandelion in a meadow ecosystem, and how does it make its living?
Once you clarify your question, I can provide you with a detailed answer.