The equation for a Joule is 1.0 J = N - m (newton-meter), which is also equivalent to 1.0 kilogram-m^2/sec^2. The Joule is a derived SI measurement unit for energy or work. The definition of a Joule is given as the quantity of work done by a force of 1 newton on a body to move it 1 meter in distance.
The reason that 1.0 J equals 1.0 kilogram-meter^2/second^2 is because the newton, which is a measurement unit used for force, is another SI derived measurement that is equivalent to 1.0 kg-m/sec^2. By substituting this fact for newton in the equation 1 Joule = N- m, the equation then becomes 1.0 Joule = (1.0 kg- m/s^2) x m, or 1.0 kg- m^2/s^2.