Drain brake fluid
It’s worth taking this opportunity to renew the brake fluid, so save yourself mess by draining the system before removing the master cylinder. Open the bleed nipple furthest from the master cylinder in each circuit in turn and pump the pedal.