Do not wait until the day of the doctor's appointment to surprise your child with the news that he'll be getting a shot. Many parents do this, reasoning that if they tell their child in advance, "he will worry about it all week." However, NOT telling your child in advance a) suggests that YOU think shots are so overwhelming and awful that he should, too, and b) denies your child a chance to develop and practice a good coping plan.
Tell him about the shot matter-of-factly, modeling calm behavior. If he expresses distress, you can empathize and reassure him that it's a normal reaction: "I understand that you're nervous – lots of people don't like shots."
Do not overly reassure your child ("It'll be okay! It'll be okay!") or tell him, "Don't worry – it won't hurt." First, shots do hurt, which he already knows. Second, the greater purpose here is to help him realize he can act bravely even when things are painful.