How can I avoid being impoverished by the high cost of nursing home care?

How can I avoid being impoverished by the high cost of nursing home care?