The prices of shares on a stock market can be set in a number of ways. The most common way is through an auction process where buyers and sellers place bids and offers to buy or sell. A bid is the price at which somebody wishes to buy, and an offer (or ask) is the price at which somebody wishes to sell. When the bid and ask coincide, a trade is made.
The overall market is made up of millions of investors and traders, who may have differing ideas about the value of a specific stock and thus the price at which they are willing to buy or sell it. The thousands of transactions that occur as these investors and traders convert their intentions to actions by buying and/or selling a stock cause minute-by-minute gyrations in it over the course of a trading day.
A stock exchange provides a platform where such trading can be easily conducted by matching buyers and sellers of stocks. For the average person to get access to these exchanges, they would need a stockbroker. This stockbroker acts as the middleman between the buyer and the seller. Getting a stockbroker is most commonly accomplished by creating an account with a well-established retail broker.