Determine the status of your flirting target before you approach her.
Do a quick "ring check" to be sure she's not married or engaged--this could save you some time and embarrassment. Next, try to read her body language. If she looks unapproachable or like she's hiding, she may not be open to flirting. You want to pick a girl who looks friendly and hopefully single.
Approach the pretty girl with confidence, but don't be cheesy or aggressive.
The best way to start a conversation with someone is by asking her a genuine question. One-liners are typically a bad idea. If you're in the grocery store, ask if she knows where the arugula is. Your first impression is both the hardest and the most important move.
Relax and keep the conversation light and fun.
Humor is always a good thing; just don't make any off-color comments.
Smile at her and use body language to let her know you're interested, without being creepy or overbearing.
Lightly touch her wrist or shoulder if there's an appropriate opening. Make the most of your short conversation.
Invite her for coffee or an event if you think she's interested in you.
This is the second most difficult task because it can be awkward. If you want to see this girl again, don't just flirt and run.
Make an offer to see her again, but give her an out.
Ask if she'd like to have coffee sometime, while writing down your number. This way, if she's not interested, she'll likely just nod and tell you she'll give you a call. If she is interested, she'll probably tell you right there, or she'll call you later--either way she'll have your number.
Have fun and remember that everyone likes to feel like they're desirable.
Even if you think a girl is out of your league, a little flirting never hurt. Worst case scenario, you'll get more practice for the next pretty girl.