fft would be one method: fft the signal, find the bin that corresponds to 50 Hz, zero that entry (and its mirror) and ifft() back.
More commonly you would use a band-stop filter.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!