Reactions of alkynes with sodium/ammonia vs sodium amide
Sodium in ammonia ($\ce{Na/NH3}$) and sodium amide ($\ce{NaNH2}$) are very different sets of conditions, despite superficially looking similar!



Sodium metal itself, $\ce{Na}$, is a one-electron reducing agent – it is oxidised to $\ce{Na+}$ in the process. When it reduces neutral hydrocarbons, negatively charged species are formed, which pick up a proton from the ammonia solvent. Overall, $\mathbf{Na/NH_3}$ is a way of reducing some organic compounds (including alkynes).

Internal alkynes $\ce{R-C#C-R}$ can be reduced to trans-alkenes using $\ce{Na/NH3}$. Specifically, solvated electrons are created which add to the triple bond as shown. Ammonia acts as a proton source to protonate the carbanions formed. The vinyl anion intermediate 4 can interconvert between a cis and trans geometry, and the trans geometry is preferred as this minimises steric repulsion between $\ce{R^1}$ and $\ce{R^2}$. When this anion is protonated, the trans-alkene is formed. This is a nice synthetic procedure for the preparation of trans-alkenes, complementary to Lindlar hydrogenation which produces cis-alkenes from alkynes.





On the other hand, in sodium amide $\ce{NaNH2}$, sodium is already in the +1 oxidation state and is no longer a reducing agent. However, the amide ion $\ce{NH2-}$ is a very strong base (the $\mathrm pK_\mathrm a$ of ammonia, $\ce{NH3}$, is 38). So $\mathbf{NaNH_2}$ is a way of deprotonating some organic compounds (including terminal alkynes).

The proton attached to the terminal carbon in a terminal alkyne is acidic enough ($\mathrm pK_\mathrm a \sim 25$) to react with sodium amide, forming the corresponding carbanion 7. Such carbanions are good nucleophiles and can be used in many synthetic procedures involving nucleophiles, such as addition to a carbonyl compound, as illustrated here.