Refrain means to choose not to do something or partake of something.
- The students were asked to refrain from leaving class early.
Restrain means to immobilize by force or forbid an action.
- The nurses had to restrain the patient in order to avoid injury.