A simple way to state the equivalence between energy and mass of a particle is to extend the concept of the Newtonian three-momentum to a Lorentzian four-vector.
$p^\mu = m dx^\mu / d\tau$
where:
$\mu = 0, 1, 2, 3$
$p^\mu$ = four-momentum
$x^\mu$ = (ct, x, y, z)
$m$ = rest mass
$\tau$ = proper time
As $dt / d\tau = \gamma$, and showing correct units you define $\gamma m c = E / c$,
where:
$\gamma = 1 / \sqrt{1 - v^2 / c^2}$ Lorentz factor
$v$ = Newtonian velocity
Hence:
$p^\mu = (E/c, p^i)$
where:
$i$ = 1, 2, 3
By contracting the four-momentum with itself you get an invariant:
$p_\mu p^\mu = -E^2 / c^2 + p^2$ (1)
where:
$\eta_{\mu\nu} = diag(-1, 1, 1, 1)$ Lorentzian metric
$p^2 = p_i p^i$
In the rest frame of the particle you have:
$(p_\mu p^\mu)_0 = -E^2_0 / c^2 = -m^2 c^2$ (2)
From which you have:
$$E_0 = m c^2$$
Being an invariant, by equating (1) and (2):
$E^2 = p^2 c^2 + m^2 c^4$ (3)
Which relates the energy in a generic inertial reference frame to the rest mass of the particle and its momentum. What is particularly valuable is that it works for a massless particle (photon) as well.
Note: if you Taylor expand (3) vs. the velocity for a non-relativistic motion and neglect higher-order terms you get the Newtonian kinetic energy of the particle plus its rest energy. This is a confirmation of the procedure.