Bye, by and buy sound the same but are spelt differently. They can trip you up when you write in English. The three words function differently in a sentence and you should pay attenetion not to mix them up.
Bye is short for goodbye. Use it to express good wished when someone leaves.
- Bye, Susi. See you next week!
By is a preposition:
- use it to show who does something
- I’m reading a book by James Joyce.
- use it to show how something is done
- We went to the station by tram.
Buy is a verb meaning the exchange of money for goods.
- They buy fresh bread every morning.