If you already are receiving social security benefits, you’ll automatically be enrolled in Medicare Part A and Part B. They will send a letter a few months before you’re elgible.
If you don’t get social security benefits and are not ready to apply for them yet, you should sign up three months before your 65th birthday. The easiest way is by applying online through social securities website
www.ssa.gov/benefits/medicare/ or by calling them directly at 1-800-772-1213.