I believe the answer is: by purchasing shares of the company
By purchasing a certain amount of shares, that investor automatically became part-owner of the company. For majority of companies, every 4 months, the company would announce the amount of dividend that they will give to the share owners. The amount of dividend that the owners receive would be according to the percentage of shares that they own.