The field equations come from differentiating the lagrangian. See https://physics.stackexchange.com/questions/3005/derivation-... for example. Youll need to read a bit on calculus of variations. Usually in university this is gently introduced through the lagrangian formalism of classical mechanics