Most simple compounds only have two words in their names. Let's start with carbon monoxide (CO). That name tells you that you have one carbon (C) atom and one oxygen (O) atom (you can also use the prefix MONO to say one atom). Remember that the second word ends in -ide. So...
(1) Carbon + (1) Oxygen = Carbon monoxide (CO)
Now we'll build on that example. What if you have one carbon (C) and two oxygen (O) atoms?
(1) Carbon + (2) Oxygen = Carbon dioxide (CO2)