None of the atoms in our representation of the #O=C=O# molecule bear a formal charge. For carbon and oxygen, #Z=6# and #Z=8# respectively, i.e. there are 6 and 8 formal positive charges in the carbon and oxygen nuclei.
For neutrality, the carbon and oxygen atoms must also be each associated with 6 and 8 formal negative charges. Around oxygen there are 2 lone pairs (i.e. 4 electrons), and the oxygen has a half share in the four electrons that constitute the #O=C# bond. That's #4+2+2" (inner core)"# electrons; 8 electrons in total, and thus #O# is electrically neutral. Carbon shares 4 electrons from the double bonds, and with its 2 inner core electrons, has the required 6 electrons, 6 formal negative charges to balance the 6 positive nuclear charges.