This is the one thing alkenes cannot do. The C−H of a terminal alkyne has a pKa around 25, which is enormously more acidic than an alkene C−H (about 44) or an alkane C−H (about 50). The reason is hybridization: the alkyne carbon is sp, so its bonding electrons sit closer to the nucleus and the resulting carbanion holds its negative charge much more comfortably.
A strong enough base, NaNH₂, removes that proton and gives the acetylide ion R−C≡C⁻. Note that the base has to be strong: NaOH will not do it, because its conjugate acid, water (pKa 15.7), is a much stronger acid than the alkyne, so the equilibrium sits on the alkyne side. Amide works because its conjugate acid, ammonia (pKa 38), is a much weaker acid than the alkyne.
Deprotonate, then attack. The acetylide is the course's main carbon-carbon bond builder.
The acetylide is a strong carbon nucleophile, so it attacks an alkyl halide and forms a new C−C bond, lengthening the chain. That reaction is SN2, which brings its own restriction: it works with methyl and primary halides and fails on secondary and tertiary ones. With a hindered halide, the acetylide acts as a base instead and you get E2 elimination.
Acetylide alkylation makes carbon skeletons bigger, and the reduction reactions then set the alkene geometry. Build the chain with an acetylide, then use Lindlar or Na/NH₃ to choose cis or trans. That two-move combination shows up all over the synthesis chapter.