But how does this make it hot in the center of the star?
Imagine laying on the floor while layers of sand bags are being piled on top of you. The more layers of sand bags there are, the more crushed you feel beneath them and the higher the temperature rises.
In the same way, the more gas pressing down on the center of a cloud of gas in space, the hotter and more crushed the center becomes.
If there is not enough gas pressing down, the temperature doesn't get high enough for the gas ball to become a star.