This statement is true.
The questions of what to produce, how to produce it, and for whom to produce it are the three fundamental questions that must be answered by any economic system. Different economic systems (market, command, traditional) answer it in different ways. In a market economy, supply and demand answer (through prices) these questions. People look at what goods and services are available at what price. They decide what it is in their self-interest to buy. No one tells them what they must buy. In turn, producers rely on their self-interest to determine what to sell. They will sell those things on which they can make a profit.
In these ways, self-interest is the motivating force that allows the "invisible hand" to answer the three fundamental questions in a market economy.