Assume that:
n = number of moles (mol)
m = mass of substance (g)
M = molar mass (g/mol)
In O_2, the number of moles (n) has been provided for you = 5 moles.
In order to find the mass (m) of O_2, you first have to find the molar mass (M) of O_2.
Use this formula to help you: n = m -: M.
You know that O_2 is composed of 2 atoms of Oxygen.
If you look in your periodic table, the molar mass (is the atomic weight) of Oxygen is 16.0 g/mol.
Since there are 2 atoms in O_2, you have to multiply the number of atoms provided by the molar mass of each atom. Which is 2 xx 16.0 g/mol therefore it will give you 32.0 g/mol as the molar mass (M).
Your final step is to find the mass (m) of O_2.
Refer back to this formula to help you: n = m -: M. Now you have to make m as the subject (I'm not sure whether have you learned making an alphabet as a subject in Algebra).
To make m as the subject, send M to the left hand side therefore it will be multiplied by n. Now your formula should look like : n xx M = m.
Therefore, 5 moles xx 32.0 g/mol = 160 grams is the mass (m) when there are 5 moles of O_2.
(I'm so sorry if my explanation is too long, but I'm trying my best so you could understand.)