The first thing you need to do is to determine the number of valence electrons per atom. You can do this by either (1) drawing the electron configuration or (2) consulting the group number of your element in the periodic table.
If you go with (1), we will have these:
C (atomic number = 6) :
O (atomic number = 8) :
If you go with (2), just notice that
Now that you know the valence electrons, you have to draw the electron-dot structures.
Please notice that the bonding of electrons follow the Octet Rule (eight electrons per atom).
Hope this helps.