Place it at the very end of a scene, after the favour or rescue has played out, as the closing beat. Pair it with crowd cheering to lift a grateful moment, or pair it with a sitcom laugh when the thanks is meant as a joke.