A chemical formula describes all of the elements present and their ratios to one another for a single molecule of a particular chemical. The identities of the elements are denoted by their one or two letter symbols and their ratios are denoted by numerical subscripts. Let's look at each chemical separately.
NH3 (ammonia): 1 molecule of ammonia consists of 1 atom of nitrogen (N) and 3 atoms of hydrogen (H). Basically, for ammonia the ratio of nitrogen atoms to hydrgen atoms (N:H) is always 1:3. You have written NH4 which is not ammonia but the ammonium cation (NH4+).
Ca(OH)2 (calcium hydroxide): 1 atom of calcium (Ca), 2 atoms of oxygen (O), and 2 atoms of hydrogen. Since the subscript 2 is located outside of the parenthesis it describes both the O and H elements. Ca:O:H = 1:2:2
CO2 (carbon dioxide): 1 atom of carbon (C) and 2 atoms of oxygen. C:O = 1:2
CuSO4 (copper sulfate): 1 atom of copper (Cu), 1 atom of sulfur (S), 4 atoms of oxygen. Cu:S:O = 1:1:4
C2H5OH (ethanol): 2 atoms of carbon, 6 atoms of hydrogen, and 1 atom of oxygen. C:H:O = 2:6:1
C6H12O6 (glucose): 6 atoms of carbon, 12 atoms of hydrogen, and 6 atoms of oxygen. C:H:O = 6:12:6 which reduces to 1:2:1
HCl (hydrochloric acid): 1 atom of hydrogen and 1 atom of chlorine (Cl). H:Cl = 1:1
HNO3 (nitric acid): one atom of hydrogen, one atom of nitrogen, and 3 atoms of oxygen. H:N:O = 1:1:3
Na2CO3 (sodium carbonate): 2 atoms of sodium (Na), 1 atom of carbon, and 3 atoms of oxygen. Na:C:O = 2:1:3
NaOH (sodium hydroxide): 1 atom of sodium, 1 atom of oxygen, and 1 atom of hydrogen. Na:O:H = 1:1:1
H2SO4 (sulfuric acid): 2 atoms of hydrogen, 1 atom of sulfur, and 4 atoms of oxygen. H:S:O = 2:1:4