I use duct tape
In this response, I'm following the rest of the responders. But I sense from the way you phrased the question that you may have bought separate rope and wire leads, and may also be unsure how to connect the rope section of the halyard to the wire section. Rope to wire splices is beyond my skill level. I used to pay West or someone else $20-30 or so to do it, but now I use all-rope, as explained below.I take out all my all-rope halyards from my C27 every Spring to wash them. I use about 80ft of 1/4" line as a messenger line. Line up the bitter end of the rope end of the halyard (although it would work on the wire end too) with the end of the 1/4" line, end to end. Tape them together with about 12" of duct tape, rolling the lines into the adhesive side of the duct tape as though the duct tape was a "rolling paper" and the halyard and messenger were the "good stuff". (You know, like you did in college with that banned substance we all used to smoke back then). It likely will pass easily thru the masthead sheave, and is very easily separated when you're done. Leave the 1/4" line in place running thru the sheave until you're ready to re-run the halyard, then reverse the process. Just don't tug too hard as the splice passes thru the sheave, so you don't break the duct tape.