If the retaining wall is used in landscaping and is not too large, the load of soil it supports does not pose a danger to a building or passersby. In that case, you do not need to consult an engineer before construction.
However, if the retaining wall is intended to support a heavy soil load, a study of the material properties must be conducted to determine potential public safety risks. A civil engineer will then calculate the weight of the soil to be supported, the risks of erosion or soil slippage, etc. He or she can then determine the necessary height and width for the wall to be safe, as well as the slope angle.
For very high retaining walls (over two meters), the structure must be reinforced with straight, wedge-shaped, and cap blocks.