The most common way is through a broker. Brokers are paid to trade stocks and other securities on behalf of customers. (This is different than giving investment advice, though some brokers may also be registered investment advisers.) There are two kinds of brokers: full-service and discount.
Full-service brokers dispense advice and can even manage your portfolio - for a price. For example, a full-service broker may charge between 1.0% and 1.5% of the dollar amount of a stock purchase. So if you were to buy $5,000 worth of stock with a broker fee of 1.0%, you would have to pay $50 for that transaction. Some full-service brokers offer flat fees instead.
By contrast, discount brokers may do little more than complete transactions for you - at a more reasonable price. Some online discount brokers, for instance, offer trades for under $10. One type of discount broker, known as a share broker, charges a fee per share traded. Share brokers typically charge less per share for larger trades.
No matter what kind of broker you choose, read the fine print about fees. For example, sometimes there are strings attached to cheap trades, such as requirements to make a certain number of trades per month or to maintain a minimum balance.