Finding equation for energy density of matter
Energy density $\rho \sim nmc^2$ if kinetic energy is unimportant (and you are ignoring dark energy and other forms of energy density).

But the number density of particles varies as $a^{-3}$.

Thus
$$ \frac{\rho}{\rho_0} = a^{-3},$$
where $\rho_0 = n(0)mc^2$ is the present day energy density and the present day scale factor is 1.