Both of the above answers are spot on. Its a daunting task, but worth it in the end.
1. Remove turf, clean up tray.
2. TAPE your lines that you want to cut, double and triple check that your lines clear the bulkhead and pump cavity.
3. Mark your tape with arrows on the line you are to cut. This is an easy step to skip, but marking the correct lines will ensure you don't cut the wrong side of the tape!
4. Select your cutting tool, make precise and controlled cuts along the marked tape lines.
5. Gently pry the cut tray area and remove the cut area in as few pieces as possible.
6. Dig out all foam using various tools. (pry-bar, screwdrivers, cats-paw, your own paw and whatever else you can jam in there) BE CAREFUL AROUND COOLING LINES
7. Pressure wash inside of tray area to remove the remaining bits of foam
8. Seal ALL fittings/through hull openings and bulkhead with 3M 5200 or comparable marine sealant. This step is crucial! The inside of the tray MUST be cleaned thoroughly and all loose or floppy old sealant must be removed to ensure proper adhesion of the new sealant. (add trim tube, tray drains or larger cooling lines at this time if desired)
9. Fill tray with water after all sealant has cured for the recommended time. This will immediately expose any areas that may be leaking or require extra attention before final closing of the tray area. Now is also the last chance to reinforce the gunnel area of the hull. Highly recommended while you are in there!
10. Cut and fit new styrene foam for all accessible tray cavity areas, any areas that have voids should be filled with expanding foam. I like to leave the bottom chines open to give any water a place to easily exit through hull drains.
11. Once your tray is at maximum capacity with foam, reuse any pieces of the original tray and fiberglass you originally removed. This can save a lot of time and also give extra strength to your new repairs. Double check there are no cracks in the 90 degree edges of the tray, now is a good time to reinforce them from the inside.
12. Do your final layup for the tray area and wait for it to cure.