The traditional approach to this is to build machines to scrub carbon dioxide from the enclosed atmosphere within the habitats, to recycle and purify the water, to provide heat etc. Of course provision is made for plants and even small animals to provide food, but the effort is designed to set up and maintain a system that will require continual substantial energetic and maintenance effort to keep it running. The problem with this of course is that it maintains a shackle to Earth - the colonists would find it extremely difficult to run and maintain basic life support, never mind expansion and extension, without constant resupply from the home planet. And that is astonishingly expensive, never mind very fragile and dependent on Earth being willing or able to foot the continual bill for the sake of a few colonists.
What we really need to do is to build systems on Mars that are able to be maintained locally, that can be extended substantially without need for import from Earth, and that are robust and fault tolerant. On Mars that is a very tall order indeed. What Mars (or at least habitats on Mars) needs is not a mere life support system - it needs an ecology.
Now perhaps ecologies of some form already exist on Mars. Deep below the surface there may be indigenous microbial communities happily prokaryoting away and munching each other. Personally I doubt it, but in the case of Mars we simply don't know. In any case, it'll not support human life, so as a life support system for our colonists it's no good. What we need to do is build ecologies on Earth - interacting systems of biological organisms and geophysical processes that are effectively self-sustaining and propagating - and packaging and exporting these to Mars for reassembly, boot-up and growth. And we need these ecologies to provide for the needs of the first human Martians.
The concept of Permaculture is working with nature to create systems that are self-sustaining, or at least require a minimum of effort & expense to maintain, which can provide for our needs to a greater or lesser extent. Attempt to reduce intervention, enhance robustness, use as few complex chemicals and "artefacts" as possible, allow the system to "grow" or be extended with minimal external intervention. These principles are ideal for colonisation of planetary surfaces, but can they actually work on Mars?
There are a number of remarkable permaculture initiatives on Earth, and indeed "light touch" gardening (which is itself a form of permaculture) is one of the most popular hobbies here on Earth. Yes, we do have air and rain and warmth, as well as soils that have been worked over by organisms for millions of years, so on Earth it's relatively easy. Can we boot up such an enclosed, but expandable, ecological system on Mars?
Well, we know that the soil is favourable, at least if the results from the Mars Science Laboratory on the Curiosity Rover are anything to go by . We know there is at least the prospect of getting water ice that (again if MSL results can be applied more widely) may be pure enough, with enough trace minerals, to support plant growth in enclosed pressurised greenhouses. There is light from the sun. There is carbon dioxide in the very sparse atmosphere, that can be concentrated as required. As plants grow, they generate oxygen and organic matter for food and composting to further improve the soil. They can generate materials that can be used to extend the greenhouses further, and so the cycle can be maintained and extended.
There are significant complexities that this simple scenario does not address, but if we are going to colonise Mars and other off-Earth locations, we need to find ways of generating and supporting ecosystems that are stable, robust, and largely sustain themselves, as well as a space-faring human population that will be busy doing what we have sent them to Mars to do.
And eventually, if we can make these systems grow enough, we may be able to turn Mars green, as well as protect ecosystems here on Earth.