How do we measure the mass of a star? I recently came across the book intro to cosmology by j.v. Narlikar, where it mentions about quarks and other star and inadvertently uses mass of sun as reference. I want to know how me measure mass of a star?

I guess from the parallax method we could calculate distance?
In general one can only measure the mass of a star if it is orbiting another body or is orbited by another body.

In essence, the method exploits Kepler's third law, though the exact technique depends on what observations are available, on what timescale and with what resolution (spectral and angular) is available.

Other techniques can be calibrated using such objects as exemplars - for instance there are reasonably well-calibrated mass-luminosity or mass-color relationships.