When a coworker is retiring, it is generally a good idea to thank them and wish them a happy retirement. The message also depends on how closely the two coworkers collaborated and the nature of their relationship.
Retirement wishes may be expressed in person, but it is also a good idea to write out a card to make the person feel especially appreciated. Many people choose to thank a retiring colleague for everything they've done for them over the years. It might be useful to think back and remember any instance in which the coworker was especially helpful or considerate. Alternatively, simply writing, "Thank you for making this a great place to work" may be appropriate.
Additionally, it is important to wish the retiree well. The writer should express that he or she is happy for the colleague entering retirement, and may wish to mention any of the retiree's special hobbies or interests that he or she will have more time to pursue. For example, "Enjoy your fishing trips," may be a fun addition to a retirement greeting card.
An invitation to socialize can also be extended to a retiring colleague. If the well-wisher would like to see the retiree in the future, he or she should suggest lunch or a cup of coffee.