If they are Retriring on time, not early since that is usually a fancy word for a layoff say "Congratulations or Bon Voyage". If they are being laid off say "Good Luck on New Horizons" and help them by collecting contact info for them from the company
I just wanted to say thank you for inviting me to your party. I had a great time. I especially enjoyed the company of both you and your guests. I can't wait to see you again. Good night.
It depends on what kind of farewell- but in general, you could wish the person well in a new chapter of their life, let them know they will be missed (by friends, colleagues, etc), and celebrate the contributions they've made.
Something like it has been an honor to know this person. I will miss you all, most of all i will miss the fun i have had working with everyone. I am so sad to leave but i must move on with my life.