The protecting group most commonly used for aldehydes and ketones (in undergraduate orgo) is ethylene glycol.
It is put on using HOCH2CH2OH/H+ and removed with H2O/H+.
For a), the reaction calls for the use of acetylide with an alkyl halide. But acetylides also react with carbonyls.
So before the alkyne is deprotonated using a strong base (such as NaNH2), the carbonyl must be protected with ethylene glycol.
For b), the reaction calls for the addition of two equivalents of phenyl Grignard to the ester. The problem is that esters aren't as reactive as ketones (or aldehydes), so the Grignard would react with the ketone before it ever touched the ester! To prevent this, the ketone must be protected before Grignard is added.