If you have automation, it will keep the pump running after you turn the spa off. If not, keeping it running with the heater off and the valves in spa position will cool the heater. Let it run like that for about 5 minutes and then change the valves to the "normal" position. Heater manufacturers recommend it be done this way to avoid thermal shock to the heat exchanger and internal parts of the heater by hitting it with cold water immediately after turning it off. Heaters get upwards of 2000 degrees in the flame area. Yes, 2000. Those parts are hot and need to be cooled slowly. You can add 50% to the life of a heater, according to manufacturers, by cooling them properly after use.