The energy-momentum tensor is given by the RHS of Einstein’s equations and a check is provided by the property that it is covariantly conserved. If it’s not, then there’s an error in the calculations. These are standard exercises.
I would say that a good starting point would be to apply Noether's theorem to the energy-momentum tensor due to the symmetric, differential, and conservative property of the E-M tensor. The solution would of course be the corresponding metric and its metric tensor that satisfies the expression in terms of Noether's theorem. As you are aware, the specific solution or metric tensor is contingent up the mathematical structure i.e. the components of the given metric tensor.