Very carefully! There are several ways to go aloft on a mast. Some masts are equipped with steps. It's like climbing stairs. Many sailors use a 'Boatswains chair', which is a form of seat that attaches to a halyard. There are other devices which attach to a halyard that are too difficult to describe in a few words. The person going aloft should always be secured to a safety line which is attached to something that will prevent a fall.