To refrain from something is to avoid doing it.
The doctor asked Mary to refrain from eating fast food as part of her diet.
Example picture