Valuing stocks can be done in numerous ways, and it's often context-dependent as to which method you should use.
Objectively speaking, however, the value of any asset can be determined by "discounting its future cash flows" to their present value.
Here's a simple way you can do that with a stock:
Step 1: Determine FCFE per share (cash from ops - capex)/(outstanding shares).
Step 2: Use average annualized growth rate of FCFE over the past 10 years to determine growth rate for next 10 years.
Step 3: Discount future cash flows by "next best alternative" (SPY annualized return from past 100 years).
Step 4: Use conservative terminal growth rate of 2% or 1%.
Step 5: Use the L.A. Stevens Valuation Model
Use the L.A. Stevens Valuation Model to input the above values to arrive at a fair value per share.
If the current price of the stock is equal to the fair value, then you will receive returns equal to the rate at which you discounted the projected future cash flows.
If the current price of the stock is above the fair value, then the stock is overvalued, and theoretically, you should not receive returns in excess of your chosen discount rate.
If the current price of the stock is below fair value, then the stock is undervalued, and you will receive returns in excess of your discount rate.
This model is by no means perfect, and many assumptions, as found in steps 1-4, must be made in order to create a value for your stocks. Altering these assumptions by even 1% can create radically different results for your DCF model; therefore, always consider multiple valuation methods, i.e. comparative valuations, price to free cash flow, etc., prior to determining whether the stock represents good value.