This is an essential social skill that's less about what you say, more about how you say it. Play it right and this can be a delightful little game of ambiguity that is both fun to perform and fun to experience. There are two types of flirting: social and romantic.
Social flirting helps the world go round. There are many situations (work do's, parties) where some light, enjoyable flirting, with someone you have no romantic interest in, is appropriate. Successful social flirts put those around them at ease; they recognise the line between fun and sleaze.
Romantic flirting has a purpose. A background information check is essential - is your target single, married, is your best friend also interested? A few secret smiles and some careful eye contact (no staring) is a good starting point. Conversation should be kept fun and light, with the opportunity to include a few teases and gentle physical contact (a touch of the arm, a light nudge). Successful romantic flirts recognise when to stop and move on, but they also know how to leave someone wanting more (of them).
Flirting should always be tempered to avoid any hint of desperation. It must also - if at all possible - be tuned to the target. Remember that playfulness can often be confused with sexual desire so don't over-impose yourself - never advance to making a move unless positive signs encourage it.
Flirting is all about being appropriate. Never flirt with your
best friend's other half, or your partner's best
friend/brother/sister/mother/father. There are also a number of
situations in which any type of flirting would be quite
distasteful. Be wary of indulging if at a funeral or in
a hospital or courtroom...
P.S. Men should remember that flirting is subtle; wolf whistling, shouting to get attention or bum pinching is never appropriate.