I currently know of two methods. The first is the “traditional” way, which is described in the “Basic Boating Book”. This is done with the mast upright.
The second method for a horizontal mast uses a long rod (thanks for details Oliver!)
Have a look at the post at the top of the forum list called “Basic Boating Book” and the comment below it for details.
Not tried it. But filed away in the grey matter for one day: tie/tape a thin messenger line to a hex screwdriver bit and using a strong magnet, draw the bit along to the exit, then tie the halyard to the line & pull through. Old hard drives are good sources of seriously strong magnets, or eBay.
I used a “fish” the type used to run wires through conduit or a hollow wall. It’s a semi-flexible coil of plastic. I taped the halyard to the end and ran it through the mast while it was sitting in my basement. Worked a treat