I was the solo IT guy for a marketing company for 15 years. They always treated me fairly, but as time went on, there was less and less work. They outsourced the job, and gave me a 3 month severance, with health insurance (like I was still working), contingent on my cooperation with the consultants they retained to replace me.
There were no hard feelings at all. From time to time for a decade I got the odd call with questions, and was glad to help as much as I could.