The phrase "to beat off" is an idiomatic expression that means to masturbate or to achieve sexual arousal and orgasm by manually stimulating one's own genitals. The origin of this phrase is unclear, but it may be derived from the idea of using physical force to remove something (in this case, semen) from oneself.