On the way + place is used to mean “while I was traveling to that place.” You can use this phrase in the beginning, middle, or the end of your sentence with no change in meaning:
- I bought a cup of coffee on the way to work (or) On the way to work I bought a cup of coffee.
- I’m going to stop at the deli on the way home (or) On the way home I’m going to stop at the deli.
- Can you pick up some milk on the way home?
- On the way to the concert we passed Lady Gaga’s tour bus.
- I saw Jack on the way to the meeting this morning.
Something or someone that is in the way means something or someone is obstructing the way, view, or effort of another person or thing:
- Don’t leave your suitcase in the aisle of the train. It is in the way of the other passengers.
- At the theater, the tall guy sitting in front of me was in the way and I couldn’t see the stage.
- During the race, several slower horses running next to each other were in the way and Jack’s horse couldn’t run ahead of them.
- My boss said I could have a vacation next week, but it seems like the HR manager is in the way of me getting the final approval.
By the way is used to mean “Oh, that reminds me” and is a way to change the topic or introduce a new topic.
- Jack: I was working on the ABC report today.
- Jim: How’s it going?
- Jack: Not too bad. Oh, by the way, the boss wanted me to tell you to stop by his office before you go home.
- Jane: That was such a great movie.
- Jenny: Yeah, I enjoyed it. By the way, do know the name of the actress who played Elsa?
- Jane: Of course! It was Ingrid Bergman.