There are two different ways to describe the composition of a compound: in terms of the number of its constituent atoms (like C2H6) and in terms of the percentages (by mass) of its elements. When showing the constituent atoms of a molecule, you can either show the chemical formula, which shows the real number of atoms in the molecule, like C2H6, or show the empirical formula, which merely shows their relative amounts in a substance, so the above molecular formula would be expressed as CH3.
You can describe the composition of a compound in terms of the weights of its constituent elements by determining the percent composition of particular elements in the molecule. To calculate percent compositions, you would find the weight of each constituent atom, then figure out what percent of the total molecular weight it makes up. Consider ethanol, C2H5OH. Taking subscripts into consideration, you have 2 mols of carbon, 6 mols of hydrogen (5 + 1), and 1 mol of O. Now convert moles into grams for each constituent element as well as for the entire molecule:
Mass of C = 2 12.01= 24.02 g
Mass of H = 6 1.01= 6.06 g
Mass of O = 1 16.00= 16.00 g
Mass of 1 mol of C2H5OH = 46.08 g
Now use the formula you learned above to find the percent compositions of the constituent elements:
Mass percent of C: 100% = 52.14%
Mass percent of H: 100% = 13.15%
Mass percent of O: 100% = 34.77%
Not so bad, right?