'by the way' is an adverbial phrase meaning incidentally or in passing. It is often used to introduce a comment that is tangential to the main subject. For example, 'I got my promotion today, by the way.'
1. I was in town, by the way, and thought I'd drop in to say hello.
2. By the way, I think you forgot to return that book to the library.
3. She sent me a birthday card, by the way.
when using the phrase 'by the way' as an adverb, it should typically be followed by a comma. Additionally, be sure to use it at the beginning of the comment in order to emphasize its incidental nature. For example, 'I wanted to let you know, by the way, that I'm sick today' would be much clearer as 'By the way, I wanted to let you know that I'm sick today.' Finally, be sure to use it sparingly in order to avoid casting doubt or skepticism on a statement.