How does the CAPM work?
To understand the CAPM, you need to understand the underlying concepts behind it.
First, the beta is a ratio that refers to a stock's expected volatility compared to the market as measured by the S&P 500. A beta of 1 would mean that a stock would have the same expected return as the S&P 500. A beta of 2 would mean that the stock would be expected to be twice as volatile as the S&P 500. If the S&P 500 rose 10%, the stock would fall 20%, and if the S&P 500 fell 10%, the stock would fall 20%. You can find the beta for a stock from a financial news platform like Yahoo! Finance.
If the stock had a beta of 0.5, the stock would gain just 5% if the S&P 500 rose 10%.
The risk-free rate is generally considered to be the 10-year Treasury yield since Treasuries are the safest investments available, and the equity risk premium is based on the difference between the market's expected return and the risk-free rate.
In the case of the S&P 500, the expected return might be 9%, which is its historical average annual return.
Once you have those numbers, you can determine the expected return on the stock or how much you should be compensated based on the beta and the risk-free rate. In other words, the riskier the stock, the greater the return you need to justify the investment.