Just to think about this is mind boggling. But how do scientist get these numbers? What technology/system/theory do they they use?
It's a matter of statistics.
Scientists take a small amount of the space (let's say 1 second of arc). They look at it carefully with strong telescopes, and count all the stars and galaxies they see. Then, they extrapolate that number at the total visible space.
Of course they can compute several spots of the space and make an average count.
Since the number is extrapolated, that's why it doesn't really matter if it is 100 billion or 300 billion of stars. The goal is to have an order of magnitude as pointed by Moriarty.