the four-momentum
In Newtonian physics energy and momentum are separate bookkeeping. Relativity fuses them into a single four-vector: the four-momentum packages a particle's energy as its time component and its ordinary momentum as its space components. Conservation of energy and conservation of momentum thereby become one law — the conservation of a four-vector.
The four-momentum is p^mu = m U^mu = (E/c, p_x, p_y, p_z), where m is the (rest) mass, U^mu the four-velocity, E = gamma m c^2 the relativistic energy, and p = gamma m v the relativistic three-momentum. Its invariant magnitude is p·p = eta_munu p^mu p^nu = (E/c)^2 - |p|^2 = m^2 c^2, the same in every frame. In a collision or decay the total four-momentum is conserved: the sum of p^mu(in) equals the sum of p^mu(out) — a single equation that encodes energy and momentum conservation simultaneously.
This is the workhorse of particle physics. Because p·p = m^2 c^2 is invariant, you can compute an unknown particle's mass from the energies and momenta of its decay products (the 'invariant mass'), whatever frame you measure in. Caveat: the m here is the invariant rest mass, a fixed property of the particle; the older velocity-dependent 'relativistic mass' gamma m is now discouraged because it obscures that m is the frame-independent magnitude of p^mu. For a photon m = 0, giving E = |p|c and a null four-momentum p·p = 0.
Two photons each of energy E fly apart back-to-back. Individually each has zero mass (p·p = 0), but the total four-momentum is (2E/c, 0, 0, 0), whose invariant magnitude gives a system rest mass M = 2E/c^2. This is how a massless pair can carry nonzero invariant mass — the basis of 'converting energy to mass'.
Four-momentum conservation lets you assign an invariant mass to a system of particles.
Only the total four-momentum is conserved, and only in the absence of external forces; individual particles' four-momenta change in interactions. Kinetic energy alone is not conserved in inelastic collisions, but the full energy component E (including rest energy) is.