Is it by or bye?
It can be by or bye.
Spell it “bye” if you mean “goodbye.”
Spell it by if you are using it as a preposition (e.g., “… written by Shakespeare,” “A town by the sea,” “… painted by hand”).
Have you tried QuillBot’s free Grammar Checker? It can help you to avoid mistakes with homophones like “by” and “bye.”