(i) Nitrous acid, HNO2, is unstable: it decomposes on standing, so it cannot be stored as a reagent. It is therefore produced in situ, in the reaction mixture itself, by adding sodium nitrite to the cold acidic solution of aniline. The nitrous acid is used up by the aniline as soon as it is formed.
(ii) HCl does two separate jobs.
Step 1: the first mole of HCl makes nitrous acid.
NaNO2+HCl→HNO2+NaCl
Step 2: the second mole of HCl is needed to form the diazonium salt. It provides the proton used in the reaction and the chloride ion that stays with the diazonium cation:
C6H5NH2+HNO2+HCl→C6H5N2+Cl−+2H2O
Adding the two steps cancels HNO2 and gives the overall equation, with 2 HCl on the left.
