% composition

The mass of any compound is the sum of the mass of its component atoms.  As shown below, the percentage by mass of a particular element in a compound can then be calculated

by comparing the mass of this element to the mass of the compound

comparing the molar mass of this element to the molar mass of the compound
 
For any mass of CH3OH:
mass %H = m(H)  × 100%
m(CH3OH)

It is generally more convenient to calculate % composition using the masses of the element and compound in one mole of the substance (molar masses) because these can be obtained directly from the periodic table.

For one mole CH3OH:
mass %H = 4 × M(H) × 100%
M(CH3OH)

For any mass of CH3OH:
m(H) = mass %H × 100 × m(CH3OH)  
It should be noted that the mathematical operations in the two steps above are exactly the same as those in the three step problem below.  Either method gives the same answer.
 
Schematic solution to problem: 
Calculate the mass of hydrogen in 10.0 g CH3OH.
m(CH3OH)
Known
Divide by M(CH3OH)
n(CH3OH) ×4
n(H) Multiply by M(H)
m(H)
Unknown

Once the mass% of an element in a compound is known, it can be used to calculate the mass of that element in ANY mass of the compound
 
In general:
mass %E = number of E × M(E) × 100%
M(compound)