The price mechanism is not an effective way to solve the basic economic problem because the basic economic problem cannot be solved. However, the price mechanism is a very good way to solve the problems that are created by the basic economic problem.
The basic economic problem is scarcity. Scarcity is the condition in which human wants are unlimited while resources are limited. It is not possible for everyone to have everything they want. Scarcity is a basic part of the human condition. There is no way to solve it in this world.
However, the problem of scarcity creates other problems that the price mechanism can solve rather well. The problem of scarcity means that people will have to decide (among other things) A) what to produce and B) who will get the things that are produced. The price mechanism can solve these problems.
The price mechanism can determine what to produce. Producers come up with ideas of what to produce and set a price on their products. If consumers are willing to meet that price, the producers will keep on producing the product. If consumers are not willing, producers stop making that product and try to make something else.
The price mechanism can determine who will get the things that are produced. Producers set prices for their products. Each person decides whether the product is worth buying at that price. Those who are willing and able to pay that price get the product while those who are not willing and able do not. This is not a perfect system because some people will not get things they need, but it seems to work better than other systems for determining who gets to have certain products.
Thus, the price mechanism cannot actually solve the basic economic problem of scarcity, but it can do a good job of solving the problems that arise because of scarcity.