Another nice feature of an HSA is the (somewhat limited) ability to adjust AGI after 12/31.
I have a Fidelity HSA and my 2% cash back Visa rewards are deposited in there, so I get a few hundred dollars of contributions that way.
I got my AGI dialed to $26 under the tax cliff I was aiming for last week.
This week, I messed up by giving away too much money to my kids and overdrew my checking account by a few hundred. Whoops.
But I can sell some stock today to fix my overdraft in the next day or two (bank doesn't care, they're probably advancing me off my credit card so I'll pay a few bucks in interest).
But that bumps my AGI by more than $26, so I'm going over my cliff.
No big deal. I just wait until February, do my taxes, see how far over my cliff I am, then contribute that much plus $1 to my HSA in February for 2023. As long as I have contribution headroom, and I do, this works.
I just about pay for the overdraft fee by tax optimizing that last $26.