I assume you mean that you know what molecule it is, and how many grams of the substance you have, and want to know how many moles of the molecule you have.
1. Count how many atoms of each chemical element are present in the molecule.
2. Use a list of atom weights to find out the atom weight of each of the present atoms, i.e. the mole weight for every atom.
3. Add together the mole weight of the atoms in the molecule. This is the molecule weight.
4. Divide the weight of the substance you have with the molecule weight, and you will get the number of moles.
Example: I have 500.0 g of ethanol. How many moles is that?
1. The chemical formula of ethanol is C2H5OH, so every molecule consists of two carbon atoms, six hydrogen atoms and one oxygen atom.
2. I use a book to look up the atom weights, and find out that the following:
Carbon weighs 12.01 g/mole
Hydrogen weighs 1.008 g/mole
Oxygen weighs 16.00 g/mole
3. (2 * 12.01) + (6 * 1.008) + (1 * 16.00) = 46.068
4. 500.0 g / 46.068 g/mole = 10.85 moles