In a renormalizable relativistic quantum field theory (QFT) in $d=4$ space-time dimensions, the general rule for constructing the Lagrangian is the follwing: Write down all possible local terms with (operator) dimension $\le 4$ respecting the space-time symmetries (Poincare invariance of the action integral) and possibly further internal symmetries.
Example: The list of all allowed terms for a renormalizable Poincare-invariant QFT with a single real scalar field $\phi(x)$ without any further additional symmetries is given by
\begin{align}
\phi, & \quad (\text{operator dimension} \; [\phi]=1), \\[5pt]
\phi^2, & \quad ([\phi^2]=2),\\[5pt]
\phi^3, & \quad ([\phi^3]=3), \\[5pt]
\phi^4, & \quad ([\phi^4]=4), \\[5pt]
(\partial_\mu \phi) (\partial^\mu \phi), & \quad ([(\partial_\mu \phi)(\partial^\mu \phi)]=4).
\end{align}
Remarks:
- Total derivative terms like $\partial_\mu \partial^\mu \phi$ (dimension $3$) or $\partial_\mu \partial^\mu \phi^2$ (dimension $4$) can be ignored as $\int d^4x\, \partial_\mu \ldots= \int d\sigma_\mu \ldots\to 0$ (surface term) in the action integral.
- The dimension $4$ term $-\phi \, \partial_\mu \partial^\mu \phi$ is equivalent to $\partial_\mu \phi\, \partial^\mu \phi$ following from partial integration $-\int d^4x\, \, \phi\, \partial_\mu \partial^\mu \phi = \int d^4x \ (\partial_\mu \phi) (\partial^\mu \phi) $.
- A term like $\phi\, a_\mu \partial^\mu\phi$ with a constant $4$-vector $a_\mu$ is forbidden as it violates Poincare symmetry.
Imposing the additional discrete symmetry $\phi \to -\phi$ on the Lagrangian reduces the allowed (linear independent) terms to
$$
\phi^2, \; \phi^4, \; (\partial_\mu \phi) \, \partial^\mu \phi.
$$
The corresponding QFT is referred to as $\phi^4$ theory. The counterterms of this model are thus given by
$$
\Delta \mathcal{L}= c_1 (\partial_\mu \phi) (\partial^\mu \phi)+ c_2 \phi^2 + c_3 \phi^4,
$$
where the constants $c_{1,2,3}$ can be tuned in such a way that the UV-divergences generated in the loop expansion can be absorbed to all orders, such that observable quantities (mass of the associated scalar particle and scattering cross sections) remain finite. Note that (because of renormalizability), the terms occuring in the counter-term Lagrangian $\Delta \mathcal{L}$ have the same structure as the terms in the tree Lagrangian
$$
\mathcal{L}_0 = \frac{1}{2} (\partial_\mu \phi) (\partial^\mu \phi) - \frac{m^2}{2} \phi^2- \frac{\lambda}{4!} \phi^4
$$
you are starting with.
Further details can be found in any text book on (relativistic) QFT.