NaNH2 (sodium amide) is a really strong base.
Na always has a +1 charge (when in a compound) so NH2 has a -1 charge. Nitrogen doesn't "like" to be negative!
NaNH2 is usually introduced along with terminal alkynes. A terminal alkyne is somewhat acidic (pK ~ 25) due to increased s-character (sp instead of the usual sp3, and the s-orbital is more electronegative than the p-orbital).
The pKa of ammonia (NH3) is about 35, so NH2- is a very strong base, and can deprotonate a terminal alkyne:
NaNH2 + HCCH -> NH3 + NaCCH
And that NaCCH can then act as a nucleophile:
NaCCH + CH3Br -> NaBr + CH3CCH
Using NaNH2 with a terminal alkyne is usually the first carbon-carbon bond forming reaction students learn.
Example problems:
www.mendelset.com/problems/286
www.mendelset.com/problems/307
www.mendelset.com/problems/561