Balanced equation
#"2CO"("g") + "O"_2("g")"##rarr##"2CO"_2("g")"#
To calculate moles #"CO"# and #"O"_2"# required to produce #"10 mol CO"_2"#, multiply mol #"CO"_2"# by the mol ratio between the desired reactant and #"CO"_2"# in the balanced equation, with the desired reactant in the numerator.
#10color(red)cancel(color(black)("mol CO"_2))xx(2"mol CO")/(2color(red)cancel(color(black)("mol CO"_2)))="10 mol CO"#
#10color(red)cancel(color(black)("mol CO"_2))xx(1"mol O"_2)/(2color(red)cancel(color(black)("mol CO"_2)))="5 mol O"_2"#