You can use an HSA to pay the expenses of yourself, a spouse or your dependents.
There are rules that limit how much and when you can contribute to an HSA, but once the money is in the HSA, you can pretty much spend it on any qualified medical purposes, even if you are no longer allowed to make contributions.