Find the number of valence electrons the neutral atom has using the periodic table (4 for carbon, 5 for nitrogen, 6 for oxygen, 7 for iodine, just to give some random examples).
Draw the correct Lewis dot structure for the compound (the structure where each atom is written out, all bonds are shown with lines, and all lone pairs are drawn).
From the number of valence electrons your atom "normally" has (4 for C, 5 for N, etc), subtract all of the lone pair electrons drawn on that atom in the Lewis structure. Then from that number, subtract 1 for each bond the atom of interest is involved in (double bonds count as 2, triple bonds as 3).
The result is the formal charge.
e.g. look at the structure on the left here
http://www.cartage.org.lb/en/themes...bonding/bondingindex/FormalCharge/H2SO3-2.gif
To find the formal charge of S in the left-hand structure at this link,
from the periodic table, observe that the "normal" number of electrons for S is 6
from 6, subtract 2, because the S atom in the structure has two lone pair electrons on it - you now have 4
from 4, subtract 4, since the sulfur atom is involved in 4 bonds (you count the S=O bond twice, since it's a double bond)
the result 0. the formal charge on that sulfur atom is 0.