In this answer I will address the second method that you mention in your question.
So that approach was proposed in a 2016 question submitted by Russell Yang. My opinion: while that method eventually produced the correct equation of motion, that method is encumbered with unnecessary complexity.
To explain why that is, and to explain the validity of energy approach in general I derive the work-energy theorem.
The starting point is Newton's second law:
$$ F = ma \tag{1} $$
The next step is to integrate both sides with respect to the spatial coordinate, integrating from starting point $s_0$ to final point $s$
$$ \int_{s_0}^s F \ ds = \int_{s_0}^s ma \ ds \tag{2} $$
The work-energy theorem hinges on the fact that the two factors in the right hand side of (2), acceleration $a$ and position coordinate $s$, are not independent of each other; acceleration is the second derivative of position.
We proceed to work out the right hand side.
In the steps starting with (5) the integrand $a$ is converted to velocity and the differential $ds$ is converted to $dv$, using the relations (3) and (4)
$$ v = \frac{ds}{dt} \ \Leftrightarrow \ ds = v \ dt \tag{3} $$
$$ a = \frac{dv}{dt} \ \Leftrightarrow \ dv = a \ dt \tag{4} $$
(5) is the right hand side of (2) (The factor $m$ for mass is temporarily omitted; it is a multiplicative factor that is just carried over each step.)
$$ \int_{s_0}^s a \ ds \tag{5} $$
$$ \int_{t_0}^t a \ v \ dt \tag{6} $$
$$ \int_{t_0}^t v \ a \ dt \tag{7} $$
$$ \int_{v_0}^v v \ dv \tag{8} $$
First (3) was used to change the differential from $ds$ to $dt$, with corresponding change of limits. Next (4) was used - with change of limits - to arrive at (8).
So we have the following mathematical relation:
$$ \int_{s_0}^s a \ ds = \tfrac{1}{2}v^2 - \tfrac{1}{2}v_0^2 \tag{9} $$
(9) is very general; it is valid for any acceleration that is integrable. The definitions (3) and (4) are sufficient to imply (9).
Notice especially that (9) is not specific to mechanics. The form of (9) is applicable in any situation where the description of physics taking place is in terms of position coordinate, first derivative of position, and second derivative of position.
We use (9) to go from (2) to the work-energy theorem:
$$ \int_{s_0}^s F \ ds = \tfrac{1}{2}mv^2 - \tfrac{1}{2}mv_0^2 \tag{10} $$
The left hand side of (9) is the expression for work done; as we know: potential energy is defined as the negative of work done.
The work-energy theorem expresses the relation between Force-Acceleration on one hand, and Potential-Kinetic on the other hand.
Implementation
The work-energy theorem is an expression in terms of integrals: that means that it is an expression in terms of increments.
The following expression is equivalent to (9):
$$ -\Delta E_p = \Delta E_k \tag{10} $$
The $\Delta$ of (10) is change over time. (10) is valid down to infinitisimal increments of time, therefore the time derivative of the sum of potential energy and kinetic energy will be zero:
$$ \frac{d(E_p + E_k)}{dt} = 0 \tag{11} $$
(11) explains why the approach proposed by Russell Yang eventually produced the equation of motion.
However, there is a much, much better way to capitalize on the work-energy theorem.
The setup is as follows:
take any point along the true trajectory and examine the effect of an infinitisimally small virtual change of the position coordinate, relative to the true trajectory.
So that is a $\delta$ of position; not a $\delta$ of time.
In case of $\delta$ of time:
the kinetic energy and potential energy are counterchanging; one is converted to the other.
As you examine virtual $\delta$ of position:
the two energies are co-changing.
The Euler-Lagrange equation expresses the idea of examining the effect of a virtual change of position coordinate.
In classical mechanics: the operation that the Euler-Lagrange performs is the inverse of the operation that we performed to obtain the work-energy theorem.
The potential energy:
The operation that the EL-equation performs on that is to take the derivative with respect to position.
The kinetic energy:
We have that the operation that the EL-equation performs on the kinetic energy is not transparent. We do know this: that operation must be dimensionally the same as the operation that is performed on the potential energy.
So:
-We know the EL-equation is valid
-the inputs of the EL-equation match each other dimensionally
-the outputs of the EL-equation match each dimensionally
It follows: the operation that the EL-equation performs on the kinetic energy is in fact differentiation with respect to the position coordinate.
That is: for classical mechanics the EL-equation is effectively the following equation:
$$ \frac{E_k}{ds} - \frac{E_p}{ds} = 0 \tag{12} $$
(As explained earlier: this is derivative with respect to the position coordinate $s$, not derivative with respect to time. (12) expresses examination of virtual displacement of position, hence in (12) the derivative of the potential energy is subtracted from the derivative of the kinetic energy.)
Example:
Let's say we have a cilindrically symmetric object, and an applied torque is causing angular acceleration. We will use polar coordinates to express the dynamics.
We integrate the torque to obtain an expression for potential energy, and we express the state of rotation in terms of rotational kinetic energy.
We insert the expressions for potential energy and rotational kinetic energy into the EL-equation:
The resulting equation of motion is then in terms of torque and angular acceleration.
Multiple degrees of freedom
Of course: energy approch generalizes to multiple degrees of freedom.
The standard is to use index notation for the respective degrees of freedom. The EL-equation is then populated with indexed expressions for the potential energy.
The expression for kinetic energy is always a single term, whatever number of degrees of freedom. The resultant kinetic energy of the velocity components along the respective degrees of freedom is the sum of the component kinetic energies. (Pythagoras' theorem is in terms of squares, and kinetic energy is proportional to the square of velocity, so it slots right in.)
With multiple degrees of freedom: the gradient of the potential energy tells you in which direction the acceleration will be, that is sufficient.
As pointed out by PSE contributor Kevin Zhou: "in physics you can often run derivations in both directions"
The Euler-Lagrange equation is an operator that takes the derivative with respect tot the position coordinate.
In classical mechanics we have that that when the EL-equation is populated with the Lagrangian $(E_k - E_p)$ the result is the equation of motion.
So:
the problem of finding an expression for Lagrangian density of the electromagnetic field is a reverse engineering problem: find an expression such that when you take partial derivatives with respect to position you recover Maxwell's equations.
A particularly extensive treatment of that is the one by PSE contributor Frobenius, in an answer to a question titled: Deriving Lagrangian density for electromagnetic field