I got kicked to the curb from a job I loved in 2016. New parent company didn't want anybody relatively senior (I was the senior attorney in the sub and age 63). My wife was working, but not making much and had no benefits. I spent 8 months looking for a job, discovering that 40 years of experience wasn't worth squat in today's market when you're first number on your age is a 6. I did finally get lucky, finding a job that paid about 40% of what I'd been making, but it was with a county government and had health insurance and even a pension plan. Not how I'd hoped to finish, but it has provided the bridge I needed to get me to retirement. Don't be afraid to step down in salary or in level of responsibility to get you through to retirement.