In a Tech business, to get an estimation of TAM, SAM as well as SOM, start with total demand (TAM), then into your target segment (SAM), and finally your realistic share (SOM). Use industry reports, competitors statistics and research for customers. Aids to benchmarks and validation, there is Statista and Gartner, for example.