Answer
33.17 g Mn$_2$(SO$_4$)$_3$
97.10 g caffeine
Work Step by Step
$6.022\times10^{23}$ O atoms is equal to 1.000 mol of O atoms. Find out how many moles of O atoms are in one mole of each compound, then use the molar mass to convert moles to grams.
Mn$_2$(SO$_4$)$_3$: Expanding the parentheses we find that there are 3 moles of S atoms and 12 moles of O atoms per mole of this compound. The molar mass is $54.9380\times2+32.065\times3+15.9994\times12=398.064$ g/mol
$1.000mol\space O\times\frac{1 mol\space compound}{12 mol\space O}\times\frac{398.064g}{1mol\space compound}=33.17$ g Mn$_2$(SO$_4$)$_3$
Caffeine, C$_8$H$_{10}$N$_4$O$_2$: The molar mass is $12.0107\times8+1.0079\times10+14.0067\times4+15.9994\times2=194.1902$ g/mol
$1.000mol\space O\times\frac{1mol\space caffeine}{2mol\space O}\times\frac{194.1902g}{1 mol\space caffeine}=97.10$ g caffeine