Establish an initial microstate: a random initial configuration of spins.
Make a random trial change in the microstate: choose a spin at random and flip it, si -> -si.
Compute DE = Etrial - Eold, the change in the energy of the system due to the trial change.
If DE <= 0, accept the new microstate and go to step 8.
If DE > 0, compute the Boltzmann weighting factor w = exp[-(DE)/kT].
Generate a random number r in the unit interval.
If r <= w, accept the new microstate; otherwise retain the previous microstate.
Determine the value of the desired physical quantities.
Repeat steps (2) through (8) to obtain a sufficient number of microstates.
Periodically compute averages over microstates.
This description of the algorithm is attributed to Harvey Gould.