Here is an example:
Let $O\,\vec{e}_x\,\vec{e}_y\,\vec{e}_z$ be an inertial coordinate system placed in a gravitational field of constant magnitude and direction $-g\,\vec{e}_z$.
Assume you have a bead of mass $M$ restricted to movie only along the vertical circular ring of radius $r$ on the picture under the constant gravitational acceleration $-g\,\vec{e}_z$. Assume that the circular ring spins with constant angular velocity $\omega \, \vec{e}_z$ along the coordinate axis $O\,\vec{e}_z$. Then the angle between the axis $O \,\vec{e}_x$ and the vector $\vec{OP}$ changes with time an for each moment of time $t$ it is $\omega\, t$. The position of the bead on the ring is described by the angle $\phi$ which is the angle between the coordinate axis $O\,\vec{e}_z$ and the radius-vector $\vec{OM}$. Thus, $\phi$ is your generalized coordinate. Then, given the angle $\phi$ and a specific moment of time, the position of the bead in the 3D space with respect to the inertial coordinate system is given by the (time-dependent) transformation
\begin{align}
&x = r\sin(\phi)\cos(\omega\,t)\\
&y = r\sin(\phi)\sin(\omega\,t)\\
&x = r\cos(\phi)
\end{align}
Now, the Lagrangian of this bead in the inertial coordinate frame is the standard kinetic minus potential energy Lagrangian
$$L \, =\, \frac{M}{2}\left( \, \Big(\frac{dx}{dt}\Big)^2 + \Big(\frac{dy}{dt}\Big)^2 + \Big(\frac{dz}{dt}\Big)^2\,\right) \, -\, M\,g\,z$$
But since the fact that the bead is restricted to the ring, we can express the cartesian inertial coordinates in terms of the generalized coordinate $\phi$, taking into account the predictable time-dependence of the ring's rotation
$$\frac{M}{2}\left( \, \Big(\frac{d}{dt}\big(\,r\sin(\phi)\cos(\omega\,t)\,\big)\,\Big)^2 + \Big(\frac{d}{dt}\big(\,r\sin(\phi)\sin(\omega\,t)\,\big)\,\Big)^2 + \Big(\frac{d}{dt}\big(\,r\cos(\phi)\,\big)\,\Big)^2\,\right) \, -\, M\,g\,r\,\cos(\phi)$$
After performing all the differentiations and trigonometric simplifications (and if I have calculated it correctly), the final Lagrangian becomes
$$L \, =\, \frac{Mr^2}{2} \Big(\frac{d\phi}{dt}\Big)^2 \, +\, \frac{Mr^2\omega^2}{2} \sin^2(\phi) \,-\, Mgr \cos(\phi)$$
And the corresponding Euler-Lagrange equation is
$$\frac{d}{dt} \left(\,\frac{\partial L}{\partial \dot{\phi}}\,\right) \, =\, \frac{\partial L}{\partial {\phi}}$$
$$\frac{d^2\phi}{dt^2} \, =\, \omega^2 \sin(\phi) \cos(\phi) \,+\, \frac{g}{r} \sin(\phi)$$