Remove the affected area and dry it thoroughly to prevent further moisture related issue. If there are areas where the wood appears to be soft but is still structurally sound, you can apply a wood hardener. Apply a wood filler to fill the gaps and cracks (if any). To protect the repaired or replaced section from future moisture damage, apply a wood preservative