The Lewis Diagram for Carbonate
1. Count the total valence electrons in the molecule. Add electrons for negative charge. Subtract electrons for positive charge.
2. Place the least electronegative atom in the center. (Except hydrogen.)

Go to Electronegativities chart.

3. Connect the outer atoms to the central one with single bonds. Add electron pairs as needed to form octets. (Except hydrogen.)
4. Count the electrons you have. If there are too many, replace two electron pairs with a single bond until you have the correct number of valence electons. 3 bonds x 2 = 6
10 lone pairs x 2 = 20
Total is 26. Valence is 24. Replace two lone pairs with one bond.
4 bonds x 2 = 8
8 lone pairs x 2 = 16
Total is 24. Valence is 24. Check.
5. Check that each atom (except hydrogen) has four electron pairs. C 4 bonds. O 2 bonds 2 lone pairs, or O 1 bond 3 lone pairs. Check.
There are three ways we could draw this, or three resonance hybrids for carbonate.