Selling shares that you don't own is known as short selling. You'll do this when you think the market proposition won't happen and want to take a position that's opposite to that stated in the proposition. You're making the opposite trade to those buying the shares from you, who say the market proposition will happen.
Short selling is simple to do - you just sell the shares (see How do I buy and sell shares?). If you want to exit your position at a later time you'll need to buy back the shares that you sold. For example, if you short sell 10 shares then you must buy back those 10 shares with another trade to exit your position.
Let's look at this in the context of a trade...
As you can see, you didn't need to own any shares before short selling them - you simply enter an order to sell the shares. To exit your position later you buy back the shares that you sold with a new trade.