The stock market is any exchange that allows people to buy and sell stocks and companies to issue stocks. A stock represents the company’s equity, and shares are pieces of the company.
When people talk about buying and selling stock, they mean that they’ve bought or sold one or more shares of a particular stock. The purpose for the trader is to make money. For instance, if I buy 2,000 shares of Apple stock at $190 and sell it six months later for $210 per share, I’ll make money. If Apple tanks (which isn’t likely), I could lose money, in which case I’d want to sell quickly to limit my losses.