It's easiest to socialize a cat when it is a kitten. A kitten is still learning what is "normal." If it learns at a young age that being handled and being sociable is "normal," it's more likely to be a sociable cat who's willing to be petted by strangers. Work on petting the cat all over. Start with strokes the cat enjoys, such as pats on the head, and work up to stroking it all over. Try holding its paw for a few seconds, as well as its tail. After holding it for a few seconds, reward it with petting it likes. Keep working on to petting and touching areas it doesn't like as much. If the cat gets mad, it's time to stop and try again later. Have strangers (to the cat) come into your home. Let the cat approach them first. When it does, let your friend try to pet it if the cat will let them. You can try to encourage interaction by giving your friend a treat to offer the cat or a toy the cat can play with. Give your kitten the chance to befriend other kittens. Some areas have kitten classes specifically designed to help you socialize your cat. However, if your area doesn't, consider taking your kitten to friends' houses, where you let them calmly hold the kitten. Tell them to pet it softly and talk to it in a calm voice.  As an added bonus, this step will help your cat get used to riding in the car, and it won't just associate the car with going to the vet's office. It also helps to have the kitten meet other animals on these trips.

Summary:
Begin young. Work on socialization in your home. Bring strangers to socialize. Take your kitten out to socialize.