In short, a star is a ball of gas that is held together by its own gravity. This force of gravity is continually trying to collapse the star, but it is unsuccessful because it is balanced by the pressure of hot gas and/or radiation in the star's interior. This is called hydrostatic support, in which the star is considered to be in equilibrium. During most of the lifetime of a star, the interior heat and radiation is provided by a process known as nuclear fusion. This phase of the star's life is called the main sequence, and the vast majority of stars in the universe are in this phase. After all the hydrogen in the core of a main sequence star has been converted to helium, the core starts to contract, increasing the temperature while the outer layers cool and expand. This begins the next phase of stellar evolution. The star goes through multiple levels of nuclear fusion until iron is produced in the core, thus a red giant is created. Eventually there comes a point when the star can no longer fuse elements together and at that point the star dies. For low mass stars their end results with the ejection of their outer layer into space, leaving only a degenerate star called a white dwarf. For more information on main sequence stars, red giants, and white dwarfs, click on the links above.
The formation of stars begins when a giant molecular cloud of gas and dust collapses. These molecular clouds are known as nebulae and they are extremely large - the amount of matter composing these clouds range from 10^5 to 2 X 10^6 solar masses. In these clouds, the primary component is hydrogen gas, but there are also smaller amounts of water, carbon monoxide, CO, ammonia, and NH3. There are various types of nebula, such as absorption nebula, emission nebula, and reflection nebula, but the most important concept to understand is how stars form from these nebula (Australia Telescope Outreach & Education, 2004).
Stars will form when the giant molecular cloud begins to collapse, which will cause the cloud's density and temperature to increase. There are four factors that can cause this initial collapse to begin. The first is the shock that the cloud will experience from a nearby supernova explosion, which will compress the star. The second is the spiraling arms of a nearby galaxy, which will compress the the cloud if it crosses its path. The third is variations in the cloud's density, as molecular clouds are not fixed in place. The final possible cause is nearby hot stars, which can produce enough radiation to compress the molecular cloud. For any of these reasons, the molecular cloud will begin to collapse, during which the individual gas and dust particles will move towards the center of the cloud (Australia Telescope Outreach & Education, 2004). As the temperature of the cloud increases, particles collide at faster rates, which can be explained the the kinetic molecular theory. Both the density and the temperature of the collapsing cloud are highest at its center, and because of this, the star begins to form in the center of the cloud. This new star is called a protostar.
A protostar is basically a blob of gas that is shrinking as it is heating up, and as such, temperatures are highest in its center, where there is more pressure. The rate at which a protostar forms depends on the mass of the molecular cloud - more massive clouds will form protostars at a faster rate than lower-mass clouds. Protostars are difficult to detect in visible light because they are surrounded by a cloud of dust, but they can be detected by infrared light. This is possible because the light from the protostar warms up the surrounding dust, causing it to radiate in infrared light (http://www.ipac.caltech.edu/Outreach/Edu/sform.html). The protostar will continue to heat up in its core due to gravitational pressure, and eventually it will reach a high enough temperature to undergo nuclear fusion. At this stage, the protostar is considered a main sequence star (click on the main sequence star link above for more information).
Below to the left is an infrared image of a collapsing cloud. The two arrows are pointing to two protostars within the cloud. To the right is a video explaining the formation and the general life cycle of stars. Check it out!
Below is a visual representation of the formation and the general life cycle of stars.