When you enter the HSA interview, you go through it until TurboTax asks you "Did [name] have Medicare at any time in 2023". Answer YES.
TurboTax will show you a screen asking for the HDHP coverage for each of the twelve months of 2023. For July and after, click on the Medicare or None button.
This will cause TurboTax to recalculate your annual HSA contribution limit, which may create an excess HSA contribution message. You will need to follow the instructions after that.
Two more notes:
1. Once you go on Medicare, you cannot in the future contribute to your HSA.
2. You may continue to use the money in the HSA in the future until the HSA is finally depleted of funds.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"