Recall the inverse square law:
The brightness of the Sun falls off as 1/D2 and so if we know the distance to the Sun we can infer its true brightness from its measured brightness. Seems straightforward enough, are there other problems?
Yes, we need to know the total flux from the Sun or star (which is referred to as the bolometric flux):
The atmosphere of the Earth only allows the visible and radio (plus some bands in other wavelength regions to hit the Earth's surface) and so, in order to measure the bolometric luminosity of the Sun one must send probes above the Earth's atmosphere to measure the Solar spectrum. Once this is done we can then use our knowledge of the Astronomical Unit to infer that the Solar luminosity is 3.84x1026 Watts.
This is the way in which other star's luminosities must also be determined. The bolometric flux is always difficult to measure, but the major difficulty is finding accurate distances to stars.