Shorting is the exact opposite of buying. You short a stock in an anticipation of a decrease in share price. When you short a stock, your brokerage will lend you shares that you don't own that come from that brokerages own inventory. When shorting you are borrowing shares in a stock from your brokerage. When the stocks price goes down and you want to close out your short and take in your profts you have to buy back the same number of shares, this is called covering your short.
Some get confused about the buying back part, I know I did, so let me clarify. When you buyback those shares you aren't actually going to have an actual position in this stock anymore. You're buying back shares of stock you didn't own, so when you buy back the shares you shorted it cancels out the shares you buy.
When shorting you're account has to be a margin account in order to borrow shares to short. Margin account is more risky than a cash account but it does come with a great perk. You're able to day trade 3 times on a 5 business rolling period. This is essential if you need to exit quickly to avoid losses, or reap profts. What is great about this rule is that the small account traders can day trade even without the $25,000 minimum you keep hearing about. Is that great or what?