describe two ways that nonmetals can combine with other metals?

I am assuming your use of other is extraneous and you really are talking about combing with metals and not

"other" non-metals.
By accepting electrons from the metal (ionic bond) or by sharing electrons with the metal (covalent bond).

Nonmetals can combine with metals in two ways: through ionic bonding and covalent bonding.

1. Ionic Bonding: In this type of chemical bonding, a nonmetal gains electrons from a metal to form ions with opposite charges. The metal loses electrons to become positively charged (cation), while the nonmetal gains electrons to become negatively charged (anion). The attraction between these oppositely charged ions forms the ionic bond. For example, when chlorine (a nonmetal) combines with sodium (a metal), chlorine gains an electron from sodium, and they form an ionic compound called sodium chloride (NaCl).

2. Covalent Bonding: Covalent bonding occurs when two nonmetals share electrons to complete their outer electron shells. In this type of bonding, atoms of nonmetals form molecules by sharing one or more pairs of electrons. For example, oxygen (a nonmetal) can combine with hydrogen (another nonmetal) to form water (H2O). In water, oxygen shares two of its electrons with two hydrogen atoms, resulting in a covalent bond between them.

To determine how nonmetals combine with metals, it is important to understand the periodic table, which provides information on the reactivity and properties of elements. By looking at the electronegativity difference between elements, you can predict the type of bonding that will occur. Metals tend to lose electrons and form cations, while nonmetals tend to gain electrons and form anions or share electrons to form molecules.