Place it at the end of a helpful moment, just after the favour is shown, so the thank-you closes the scene. Follow it with a brief laugh, or put a short greeting before it when you want the exchange to read as a back-and-forth between two people.