For a start, you need a Periodic Table; then you need a formula to calculate; I'll use #UF_6#.
Explanation:
The Periodic Table tells me that #"Avogadro's number"# of uranium atoms has a mass of #238.03*g#, and that such a quantity of #F# atoms has a mass of #19.00*g#. In every exam of Chemistry and Physics you ever sit, you will and must be supplied with a Periodic Table.
What is #"Avogadro's number"#? It is simply #6.022140857xx10^23# individual items of stuff, here atomic nuclei. So to get the mass of a mole, #"Avogadro's number"# of #UF_6#, I simply make the calculation #(238.03+6xx19.00)*g*mol^-1#. Formulae such as #NaCl#, #CaCO_3#, #CO_2#, #Fe(NO_3)_2#, are calculated in precisely the same way. Get the atomic molar masses (from the Periodic Table, no-one expects you to remember them!), and sum the atomic masses correctly and appropriately.
This video will show you how to calculate the molar masses of two compounds, #SiO_2# and #Mg(OH)_2#.