A good farewell message does two things: it thanks specific people for something real, and it says plainly that you are leaving. Everything else, the length, the tone, whether it is funny or heartfelt, depends on who is reading it and how well you know them.
Below are 8 examples by scenario. Copy one and fill in the brackets, or use the generator above to write a Slack message, an email, and a card note from your own details in one pass.