Whether you choose to retire early or are pushed out by layoffs, it takes careful planning. Here’s what you need to know.