First; you go in and cut out the old rotted wood. then you cut new 'good wood' filler pieces to install in the gap. (like a dentist fills a cavity) plus you add additional parallel boards for more support. then you mix up epoxy to glue everything together. then give it 24 hours to harden.
Second; Fit all the parts together to check the fit. get a carpenters Plane and plane down all the high spots so that it's all level. then wood glue and epoxy everything plus several screws to bolt it all down. in addition you throw in a 'fiberglass pad' that the mast boot drills into. (take 5 separate 1/4" thick fiberglass plates and glue them together into a very heavy solid base for the mast to sit on. it's massive and sits across all the support beams and cant rot.)
Last; after giving it another 24 hours for all the epoxy and glue to harden you pilot the sailboat back over to the marina so a crane can lower the mast back into place. then all the rigging is reattached and it's again a sailboat.