What to send
A carnation is the right flower here. It means enduring affection, and unlike a rose it does not overstate anything on a day that is already emotional.
Add lavender if the person is quiet about their own leaving. The vertical shape keeps the bouquet from feeling like a party.
What to write
Name the thing they were known for. Not “thank you for your service” — the actual thing: the way they trained everyone who came after them, the fact that they never once lost their temper in a meeting, the system that only worked because they quietly maintained it.
If you were one of the people they trained, say so. That is the sentence they will keep.
For the people who are not in the office
A retirement is often a smaller event than it looks from inside — the leaving drinks are on a Thursday and then they are gone. A message from someone who is no longer there too lands differently.