In days of yore you'd look at the fundamentals like:
- ability of the firm to service its debt
- profitability ratios
- revenue growth
- total addressable market
- competition
- market dynamics
etc.
You'd also pore over their quarterly and annual regulatory findings and see what's in the MD&A sections, assess the competency of senior leadership, look at how they view themselves, etc.
Then you'd look at comparable firms, i.e. companies doing the same or materially-similar things. Some of those are "pure plays", i.e. companies selling exactly the same product/service (e.g. TSMC, UMC, GFS) and some are not pure (e.g. red bull sells energy drinks but it also has a bunch of other stuff like a formula 1 team).
You compare your target company's fundamentals to those of its comparables, see what prices those comps are trading at, look at discounted cash flows, and then you pull a semi-informed number more or less out of your ass for the target as a forecast, based on your analysis.
These days, though, valuations are more or less completely disconnected from fundamentals. This is why Warren Buffett-style value investing is commonly said to be dead in today's market.