Place it as the final beat after the helpful moment has played out, so it closes the scene instead of interrupting it. Follow it with a celebratory sting when the thanks is meant to land big, or leave it alone when the moment is small and sincere.