First off, be aware of your surroundings. I have noticed that most people do not smile or say hi to strangers that they pass along the street, or they simply look elsewhere and are consumed with their own thoughts. Therefore, learn to look up and around your surroundings. Stop staring at the floor or sidewalk. Once you stop doing that, you’ll notice your surroundings and realize people passing by. Direct your vision to the direction of the people passing by you.
Once you have done that, make eye contact with the stranger and give a friendly smile or say “hi.” Some people prefer a smile over a “hi.” Others like to be acknowledged with a nod.
Once you pass the person with a friendly greeting or smile, simply continue to walk and do not look back! Do not turn back and glare at them unless you want to engage in a conversation with a stranger. Do this if you feel confident that the person wants to talk to you as well.
Whatever the case is, make sure that you do not wave at a person approaching you, unless you know that person fairly well. Otherwise, they’ll probably think that you are a freak. In addition, do not simply glare at someone to make eye contact with them. Say “hi” when you are at a approachable range.