The simple answer, as a rule of thumb, is to count the number of bonds on the atoms you need to passivate. A carbon atom wants to have 4 neighbors, so if it only has 3, then you need to add 1 Hydrogen atom (sp3), if it has 2 then you need 2 H (sp2), and so on. This rule is however only for carbon, and will be different for other elements (outside group IV).