Explanation:
When carbon atom tends to form single bonds then its hybridization is , when carbon atom tends to form double bond then its hybridization is and when a carbon atom is attached to a triple bond or with two double bonds then its hydridization is sp.
For example, in HCN molecule there is a triple existing between the carbon and nitrogen atom.
So, hybridization of carbon in this molecules is sp. Moreover, nitrogen atom is also attached via triple bond and it also has a lone pair of electrons. Hence, the hybridization of nitrogen atom is also sp.
Thus, we can conclude that s and p type of orbitals overlap to form the sigma bond between C and N in H−C≡N: