A representation that shows the total number of atoms or elements present in a substance along with their relative proportions is called the chemical formula of the substance.
For example, the chemical formula of hydrogen chloride is , where both hydrogen and chlorine are present in 1:1 ratio.
Formula of silver sulfide
Silver sulfide contains a silver(Ag) atom having a positive charge and a sulphur(S) atom having two negative charges. Therefore, in order to balance out the charges two atoms of silver will combine with an atom of sulfur.