Place it at the very end of a helpful moment, just after the favour or gift appears on screen, so the thanks closes the scene. Follow it with a light laugh or a short cheer to round off the exchange, rather than opening with it before the viewer knows what happened.