What primarily allows astronomers to determine the mass of most stars, including our Sun?

Answer

Observing its gravitational effect on a companion in a binary system.

The mass determination for the vast majority of stars, including the Sun, relies on meticulously measuring the orbital characteristics of stars locked together in a binary system, applying the laws of motion derived from Newton and Kepler.

What primarily allows astronomers to determine the mass of most stars, including our Sun?
measurementAstronomerstarmassbinary star system