I don't really understand how D'Alembert's principle "helps" in solving the problem in your OP, but I assume your teacher wants you to practise using it in simple situations before you try more complicated ones.
The real value of working in a non-inertial coordinate system is when such a system makes it easier to describe the problem.
For example, suppose you want to model the dynamics of an aircraft. Planes can move in any direction in 3-dimensional space, and the nose of the plane can also be pointing in any direction - not necessarily in the same direction that the plane is moving (see any video of an aerobatics display for examples!)
The easiest way to described the forces created by the plane's engines and control surfaces (rudder, tailplane, ailerons) is to use a coordinate system fixed to the plane. Since this coordinate system may be accelerating and/or rotating relative to the ground, it is not an inertial coordinate system and you have to include the d'Alembert forces depending on how it is moving.
Another example is the dynamics of rotating machinery. Suppose you want to model the vibrations of the blades of a wind turbine, while it is rotating at constant angular velocity. The easiest way to set up the model is in a coordinate system that rotates with the blades, including the d'Alembert forces. In general the blade vibration frequencies will not have any simple relation to the speed of rotation of the whole windmill, and they will depend on the rotation speed. In fact, because of the Coriolis forces on the system, even in the rotating system the blades don't vibrate back and forth in simple harmonic motion in a straight line, like the systems you study in a first dynamics course. Each point on the blade actually moves in around an elliptical path whose center is at the "non-vibrating" position. Trying to describe that motion, and set up the equations of motion, in an inertial coordinate system fixed relative to the ground would be much more complicated than using a coordinate system relative to the blade itself. And if you use a computer model to solve the dynamics of the system, the easiest way to visualise the results is to make an animation in the same rotating coordinate system - i.e. to display what you would see if you were "sitting on the blade" as it rotates.