I've been studying quantum mechanics and classical field theory for quite a while now. However, I still struggle with the idea of building scalars from vectors and tensors for the Lagrangian density. For instance, I have searched everywhere how to arrive at the conclusion that the Lagrangian for the classical electromagnetic field is given by; $$\mathcal{L} = - \frac{1}{4\mu_0}F^{ab}F_{ab} - j^aA_a$$ But no success, no sources or books show the calculations, it's just a given like the electromagnetic field strength tensor $F^{ab}$ (A little bit different, I could find one and only one book which showed the derivation of this tensor, no articles though, and surprisingly, it arrives quite naturally in the search for a contravariant formulation of electromagnetism. The book is "Tensor Calculus for Physics. A Concise Guide" by Dwight E. Neuenschwander.)
Most books (That I've read) also kind of give the interaction term $-j^aA_a$ as a given. It is said that this term comes from Noether's theorem, but, like before, no calculations are ever shown.
Even more questions arise when we take a look at the lagrangian density for quantum chromodynamics (A little jump to quantum field theory) and how the indices of the gluon field strengh tensor are built into the lagrangian; $$\mathcal{L}_{QCD} = - \frac{1}{4}G^a_{\mu\nu}G^{\mu\nu}_a +\bar{\psi_i}(i(\gamma^{\mu}D_{\mu})_{ij}-m\delta_{ij})\psi_j$$ Where $\psi_i(x)$ is the quark field, $D_{\mu}$ is the gauge covariant derivative, $\gamma^{\mu}$ are Dirac matrices and $G^a_{\mu\nu} = \partial_\mu\mathcal{A}^a_\nu-\partial_\nu\mathcal{A}^a_\mu+gf^{abc}\mathcal{A}^b_\mu\mathcal{A}^c_\nu$, where $\mathcal{A}^a_\mu(x)$ are the gluon fields. Most books say that you kind of guess a scalar using the tensors and vectors, vector potentials, spinors, etc. This seems highly unpractical and prone to error and, if it really is by guessing, where do the factors of $-\frac{1}{4\mu_0}$ and of $-\frac{1}{4}$ come from?
Can someone explain to me the derivations and maybe even show the calculations to help clear this doubt of over one year?