Before jumping into Lagrangian Mechanics (the principle of least action, the lagrangian, the Euler-Lagrange equations, etc) I want to set a bit of context around what Lagrangian Mechanics was, what it has become and importantly what it isn't.
Lagrangian mechanics was originally developed as a way to work with systems which, due to their complexity, are tedious to solve using Newtonian mechanics. Lagragian mechanics didn't technically add anything new to our understanding of physics - there's nothing you can do with Lagrangian mechanics that you can't already do with Newton's formalism - but it repackaged many existing principles into an elegant, usefull and conceptually simple framework.
200-odd years later, we're using Lagrange's formalism to describe quantum field theory and string theory. That's because Lagrangian mechanics is really a way of doing physics, rather than a theory of anything specific. That's not to say that Lagrangian mechanics doesn't say anything about the universe; some fundamental truths, common to both quantum theory and classical mechanics, are encoded within the framework of Lagrangian mechanics.
The Principle of Least action - on which Lagrangian mechanics is based - is often advertised as a theory of everything. I dislike this notion because, on it's own, the principle of least action describes precisely nothing. You still need to understand a system well enough to be able to write down the correct Lagrangian to describe it.
What does Lagrangian Mechanics actually describe?
Firstly, the Principle of Least Action hereinafter abbreviated to PoLA
But deeper than this, the PoLA fails even to describe how anything in particular works. It doesn't, in and of itself, describe any system you're likely to encounter in classical physics or quantum physics - the simple pendulum, an atom...
That's not to say that the framework of Lagragian mechanics makes no statement about the universe. Many fundamental principles, known by Newton and Galileo, are implictly encoded in the structure of Lagrangian mechanics.
LM is a convenient (and elegant) way of concisely expressing many of the general principles - some of which we take for granted - that govern mechnanics.
The General Procedure
Given some needlesly complicated system of pulleys and gears and springs, we first write down a set of parameters which completely describe the system at some instant in time. These include the rotational positions of gears, the extensions of springs, the heights of various weights suspended from pulleys. We call these the configuration parameters of the system.
Consider the simple pendulum:
The pendulum is completely described at a given instant in time by the angle, , that the rod makes with the vertical. In this case we only have a single configuration parameter, .
The next thing we do is to write down an expression, called the Lagrangian in terms of only the configuration parameters and their first time derivatives.
In general, we don't. Every different Lagrangian we could write down will describe a different relationship between the degrees of freedom and hence a different system. Figuring out which Lagrangian to write down is in the most general sense a process of trial and error.
In practice, we'll see that there are many tricks to figuring out what the given Lagrangian for a system should be, many of which revolve around the symmetries of the system.
Finally, we substitute into a funny looking equation, called the Euler-Lagrange equation:
Notice that this equation has a free index in it. This is because in writing down one equation, we've actually written equations - one for each one of the configuration parameters, . Upon substituting into this equation, and computing the partial derivatives, we will be left with differential equations in terms of the and which we can solve (if we'd like to) to determine the trajectory of the system.
Since we only have 1 configuration variable, we only have 1 Euler-Lagrange equation to compute. Substituting this Lagrangian:
This might seem like a needlessly roundabout way of arriving at the equations of motion. Why not simply start out by writing down the equations of motion? Or, better yet, derive them using Newton's laws! As we'll see later, it's generally much easier to figure out what the correct Lagrangian is for a system than it is to derive the equations of motion directly. This is part of the magic of Lagrangian mechanics.
A Brief Note on the Principle of Least Action
It's tempting to brush off classical mechanics as old physics - largely because it is. However, there are many repects in which the work that was done in the 18th century by Lagrange is more relevant today than it was when it was originally developed. The principle of least action (and everything that comes with it) may not describe quantum physics, or string theory, but it doesn't really describe classical physics either. Lagrangian mechanics is a theory of something very fundamental which applies to all modern theories. There is a reason that the name of a man who lived 1736-1813 features (prominently) in string theory and quantum field theory textbooks published today.