Yes, you can withdraw funds from your HSA at any time. But please keep in mind that if you use your HSA funds for any reason other than to pay for a qualified medical expense, those funds will be taxed as ordinary income, and the IRS will impose a 20% penalty.
After you reach age 65 or if you become disabled, you can withdraw HSA funds without penalty but the amounts withdrawn will be taxable as ordinary income.