Rig failure: a shroud, the forestay or the backstay has parted. Your first action is not a repair but a course: turn the boat so the broken side is unloaded.
Forestay parted – bear away at once and run downwind. The wind and the mainsail will push the mast aft. Don't drop the headsail straight away: a furled sail with the stay inside holds the mast forward by itself. Then take the spare halyards to strong points at the bow and winch them bar-tight. Reef the main, reduce speed and head for shelter under engine, without going back onto a close-hauled course.
Backstay parted – head up into the wind. Make an emergency support from a halyard led to the stern cleat and tensioned on a winch.
Shroud parted, even a single strand – tack so that side becomes the leeward side, and keep sailing so it stays to leeward.
Mainsail down, halyard parted – head up, gather the sail onto the boom and secure it. Check that nothing is trailing in the water under the hull.
Furler jammed – don't force it on the winch. Bear away, take the load off and check whether the halyard has wrapped around the top swivel. If it won't free, carry on under main or engine.
Mast down – people first, then the hull, then the gear. Stop the engine: there are lines in the water and the propeller will wrap them in seconds. Don't let the spar go under the hull, and only then cut the rigging away.
In short: course first, repair second.