Retiring Mid-Year: Medicare Timing

How to time Medicare enrollment when retiring in the middle of the year.