If the mast is down and horizontal , use a long fish tape. If your halyards are internal make sure that you don't get the wiring twisted around them. I don't know about your boat, but many have a conduit running inside the mast to contain the wires. The conduit also helps to keep the wire from slapping around inside the mast.
Another way, if you have the conduit present is to tie a small cotton ball to a piece of string and use a vacuum cleaner to suck it through the conduit, secure your wire to the string and pull it back through the conduit. Bring a messenger line along with it in case you ever need to pull the wire back out.
If the mast is standing, drop a piece of cord with about a foot of sash chain attached to it for weight. You can then either hook it as previously suggested, or snag it with a magnet.