E is rest energy, m is the mass, and c is the speed of light.
For example, a proton contains three quarks: two up quarks and one down quark. Up quarks weigh 2MeV and down quarks weigh 4.8MeV. So added together, a proton should weigh 8.8MeV.
But life isn't that easy, because in reality, a proton weighs 938MeV. Which basically means that the quarks energy is being converted to mass (in a sense) by the equation
This is a great website that shows how the equation is derived (both calculus based and non-calculus based).