The carbon atom needs to hybridize itself into 4 sp orbitals, each orbital needs to have 50% s character and 50% p character in order for the bond to be linear. The oxygen then hybridizes its 2 half full p orbitals and its full 2s orbital into 2 sp orbitals. They would look like this
Carbon
1s2, 2sp4
oxygen
1s2, 2sp2(not to be mistaken for sp2),2p4
Now as to the why...how to explain it properly...think about it this way. The more electronegative atom when two approach for bonding wins, by wins I mean it controls what happens. So there are 2 oxygens that each needs 2 electrons, they will do as little work as necessary to make that happen. What they will do is promote 1 2s2 electron to the p orbital leaving a half full 2s orbital and a half full 2p orbital which hybridize to form 2 2sp orbitals. The carbon simultaneously promotes 1 of its 2s2 electrons into the p orbital leaving each orbital in the second shell half full, these will hybridize into 4 2sp orbitals. Let me know if that helps at all.