Your HSA is always yours, so you can still spend your HSA money on qualified medical expenses with no federal income taxes or penalties in retirement.
Retirement-related qualified medical expenses, covered by your HSA, could include:
COBRA coverage costs
Health care coverage while you’re receiving unemployment benefits
Medicare premiums other than Medicare Supplemental coverage
Qualified long-term care coverage
If you choose to use your HSA money for something other than qualified medical expenses, you will be responsible for paying federal income taxes on it and may be penalized if you’re under age 65. You’ll also still be eligible to contribute to your HSA in retirement as long as you aren’t enrolled in Medicare5 or covered by an ineligible health plan.