Street portraits are growing in popularity, largely thanks to social media and pages like Humans of New York. The ethnical diversity that can be found in large urban areas has great potential and it would be a shame to waste it. However, it's not easy for everyone to just pick up their camera and take photos of random people with their consent. It's especially hard for introverts or people who are less used to photographing portraits.
Here is a quick guide that should help you. Remember, it's always harder when you first start. After that it gets a lot easier.
Start with people who are alone
You are more likely to be successful in getting an approval from someone who is alone. It's also easier for you, psychologically. Small groups of friends tend to clam up and that's not going to make things easier for you.
Be straightforward: ask!
After you select someone interesting to photograph, establish verbal contact. Be polite and ask them if you can take their portrait. Some might simply say "OK", while other will ask you what it's for. Be honest and motivate your initiative. If it's for a personal project, describe it to them in a few words. If the person you want to photograph refuses, walk away politely and move on to someone else.
Full body first
After the person you want to photograph agrees, take a full body picture first. It's a good way to start because it's less intimate and it will help the subject gradually feel more comfortable. It's very likely that most people you will meet on the streets are not used to sitting in front of the camera. Selfies don't count here. As a result of that, if you get too close right from the beginning, you risk intimidating them and getting the wrong facial expression. Ask them if they have a couple of minutes and take your time to get closer.
Never from behind
Never approach someone on the street from behind. It should be obvious why, yet there are photographers who make this mistake willingly. You have a good chance of scaring your subject and that could result in a variety of responses. Some might get upset, have panic attacks, get angry or simply hit you because they thought you were a burglar.
Always use a front approach and try to keep your body language as friendly as possible.
Be at their level
If you see someone sitting on a bench in the park, crouch down to their level. It's best to have a conversation of this sort at the same level, rather than you standing an looking down on someone.
Like most other things, street portrait photography takes a little practice. Once you get the hang of it, everything becomes easier. Talking to people will be more and more fun and the more portraits you take, the better a photographer you will become.