How do we measure the brightness of the stars?

How do scientists measure the brightness of so distant stars?

As light spreads from a star to the viewer, it diverges inversely proportional to the square of its distance (d) from the viewer. $$$$B \propto \frac{1}{d^2}$$$$.
The relationship between brightness (B) and luminosity (L) is described by $$$$B = \frac{L}{4\pi d^2}$$$$ (1). So we have three variables, brightness, luminosity and distance.