It's simple If you use the periodic table.
CO - carbon monoxide,
C (6) has a mass of 12.01 g/mole,
O (8) = 16.00 g/mole.
The molecular mass of CO is 12.01 + 16.00= 28.01 g/mol.