I think you have already answered your question. Yes, take your RMD, you have to take it anyway like you said. Use that cash for replenishing your savings, then tap your HSA for the 3k medical expense. That's what the HSA is for anyway. If you say, well actually i already have plenty of savings okay great, use the money from the RMD to contribute to your HSA and make sure your still maxing out your HSA and IRA contributions. This saves you the most on taxes, but just remember to take care of your immediate savings needs first