The star is stable. Despite being very massive, it does not collapse under its own gravity. This means that there is a force within the star that is opposing the inwards gravitational force. That force is a simple result of Newton’s third law: every action has an equal and opposite reaction.
The inwards force of gravity is countered by the outwards reaction due to the pressure at that depth.
As gravity pushes inwards, the plasma inside the star is compressed.
Stars essentially are balls of extremely hot, compressed, ionized gas (plasma). Their properties therefore depend on their mass, temperature, and density. Analyzing these properties gives us four equations that govern the structure of a star. The first of these is the Equation of Continuity. The equation of continuity relates the mass of a shell inside a star to the density at that distance from the center of the star.
Assuming a star is a perfect sphere, its volume is given by: