A colony in space will need a wide variety of resources to survive. Let's look at some of them and where to find them.
Earth's atmosphere is roughly 78% nitrogen, 21% oxygen and 1% argon. Nitrogen and argon are inert; as air we need them only for bulk. The pressure in a colony affects how much of each gas is needed; you can have a half-pressure atmosphere with 42% oxygen, 30% nitrogen and 28% argon and breathe just fine. You could also breathe a pure oxygen atmosphere at one fifth pressure, but this is extremely dangerous; the slightest spark can start a very rapid fire even in materials that aren't normally flammable.
When we breathe, we take in oxygen from the air and expel carbon dioxide (CO2). The life support system handles capturing this CO2 and converting it back to oxygen. There are several good sources of oxygen in the solar system, most commonly as water (H2O) and as metal oxides but also in some places as CO2. Mars for example has both water ice and CO2 ice at the poles, a CO2 atmosphere and more water ice under the soil. Most rocks are oxides of one kind or another. Quartz is silica or silicon dioxide (SiO2), while calcia and alumina are also common. Iron oxide (rust or hematite) is very common on Earth and Mars, but not on most other bodies.
Extracting the oxygen can be done through electrolysis of water easily and reliably, which also produces hydrogen. CO2 can be converted by plants into oxygen and sugars, and can also be converted into oxygen and hydrocarbons like methane using a chemical process. Most oxides can be converted by melting them and applying an electric current, and some (particularly iron) can be reduced by heat and hydrogen gas.
No system is perfect. Everything leaks. It is not enough to find a steady supply of oxygen; we need buffer gases like nitrogen and argon. Argon is a noble gas; it very rarely forms chemical compounds and it has a low freezing point. This means argon is extremely rare outside the atmosphere of a heavy planet like Earth. Helium and neon are options, though they are even more rare than argon. The atmosphere of Mars is about 1% argon and 1% nitrogen, so this is the best source other than Earth. Nitrogen is a bit more common since it forms many compounds; other than Mars as mentioned above, traces of nitrogen are present in many asteroids (particularly C-type and D-type). Huge amounts of nitrogen and organic nitrogen compounds form the atmosphere of Titan, Saturn's fourth moon. Ammonia ice is very common in the outer solar system and is an excellent source of both nitrogen and hydrogen. Tholins are complex organonitrogen compounds also found on icy bodies and could be harvested for their nitrogen, though they could be bioreactive (dangerous) or more useful as found vs. breaking them into parts.
While oxygen is easy and practically everywhere, buffer gas is rare and valuable. Expect to require resupply from Earth or Mars, most likely at great expense.
Virtually all forms of life as we know it require water. Water is commonly available as ice in asteroids and comets, as well as on most planets with atmospheres. Without access to that, one can make water from oxygen and hydrogen. As mentioned above, oxygen is fairly easy; unfortunately, hydrogen is not easy if you don't already have water. Ammonia and methane are common sources but tend to be pretty far out in the cold. Most C-type asteroids are anywhere from 5%-20% water ice; D-type can be more than half ice by weight. From about the orbit of Earth outward, water is pretty common.
We can do some amazing things with technology, but in the end it all takes power. Some kinds of industry can be done with simple heat, which is easy to provide using solar reflectors out to about the middle of the asteroid belt. Mostly though, we need reliable electricity and that means either solar panels or nuclear reactors. Solar is fine out to a certain distance, but the available power from the Sun drops off dramatically as you go further out. Solar power in low orbit or on the surface of a body also has night-time periods where it produces no power. Nuclear power is reliable and functional to the edge of the solar system and beyond, but it is heavier than solar photovoltaics (PV) and requires both shielding and some fairly rare fissile materials. Remember that every watt of power generated eventually becomes heat that will need to be radiated away; nuclear power has the additional disadvantage of producing waste heat that has to be eliminated, though this can be done more efficiently than environmental heat.
Expanding the supply of solar power means building more solar panels, which means refining very pure silicon and then adding precise amounts of other elements like germanium. This is done with a process called zone melting or zone refining; the raw materials can be found concentrated in many places (Lunar KREEP, asteroidal iron nodules, similar deposits on Earth and Mars, etc.) and needs only careful processing to be useful. A facility that can produce solar panels can also be adapted to produce LED lights, which will be essential for lighting and for growing food.
Food is heavy and expensive. Growing it in your habitat will be necessary. Plants give an added benefit of removing CO2 from the atmosphere and releasing oxygen. Unfortunately, plants are overachievers; the crops needed to feed one person can produce enough oxygen for two people to breathe. In the long term all the carbon in the colony can be cycled through, but there has to be enough of each part of the system to handle high growth periods and other unstable behaviors. Most references are focused on how much oxygen an area of plants will produce; the colony will be more concerned with trying to provide enough CO2 to keep the crops healthy. Expanding the size of the colony will require adding carbon and trace elements to the system.
Nutrients required by most plants, in decreasing order:
A growing colony needs space, which is so plentiful in space that it doesn't bear mentioning. However, in order to claim a volume of space for human use we must enclose it in something strong enough to hold the pressure of the atmosphere and the mass of the structure's contents. For habitats with spin gravity, the structure must also support its own centripetal force. A variety of materials are possible, but we want to get the most volume per kilogram of structure that we can manage. As it turns out, plastic is the answer. Specifically, ultra-high molecular weight polyethylene or Spectra (trade name). Polyethylene (polythene in many places) is formed of long chains of carbon and hydrogen. It can be produced in a chemical process with ethylene and a catalyst. Ethylene in turn can be produced from ethanol, which is readily produced by yeast as it consumes sugar. Ethylene can also be produced in a chemical process from CO2/CO/Hydrogen gases (biomass gasification). In other words, all the waste products from the food production process can be fed into plastic manufacturing.
Polyethylene has many uses depending on its molar mass. The high end has uses in bulletproof vests, high-strength fibers and ropes and as durable low-friction surfaces. Less dense forms find use in many ways including films, bags and many solid or cast parts. In our case we want a lot of very high quality UHMWPE fiber to make large composite overwrap pressure vessels as habitats. It's certainly handy to have around for other uses; it resists water, acids, bases and to some extent oxidizing agents. After an initial wetting period it does not degrade over time and can be used for cutting boards, handles, stops, etc., basically all the ways we use it on Earth. It does need to be protected from UV light, strong oxidizers and high heat.
Aluminum is a metal we know well. Strong, lightweight, durable. Aluminum (as aluminum oxide Al2O3) is very common in rocks throughout the solar system. Titanium is similarly useful though less common. Iron and nickel are both very common in asteroids as free metals, and iron oxides can be found in heavier rocks. The lighter metals can be powdered, sintered, laser welded, extruded, pressed and many other operations. The heavier metals can be treated that way too, but iron and nickel have a very useful trick: they form a gas when exposed to carbon monoxide (iron carbonyl and nickel carbonyl). Iron deposits in asteroids can be cooked in CO and all the iron and nickel will be removed. The resulting gas can be distilled to provide very high purity iron and nickel; these gases will release their metal content when heated, so large or complex shapes can be seamlessly formed in this way. Carbonyl metals are extremely toxic.
Rock itself can be useful. Regolith (properly meaning soils, but in the context of space it usually means powdered fragments of asteroids and rocks) can be baked into blocks or steam-cast into something like concrete. Good for radiation shielding and compression loads, but no useful tensile strength. Basaltic rock can be found on the Moon and other large rocky bodies; this can be melted and spun into fibers that are heavy but very strong or cast into strong panels, rods, pipes, etc.
This can be practically anything, as long as it's heavy. Heavier elements are slightly more efficient at blocking electromagnetic radiation while lighter elements are better at stopping neutrons. Bodies with an atmosphere provide the best protection, since the mass of the body itself blocks half of the radiation while the atmosphere blocks some part of the other half. I am in favor of burying the colony in an existing body so that the enormous mass of radiation shielding does not have to be harvested, processed and moved to its final location. Just dig a deep enough hole and you're on your way.
Something to Trade
A self-sufficient colony is the goal, not something that can be assumed. In the build-up to that state, the colony needs to produce something of value in order to trade for the things it needs. This resource depends on what other people are doing in space. If things have to be launched from Earth they can cost as high as $3000 per kilogram; if they can be provided for less by a colony already in space then that's a market worth making. Water is commonly cited as something valuable, as is radiation shielding and oxygen for fuel. If carbon and hydrogen are abundant then methane for fuel is another possibility. Same idea with solar panels, structural elements, large assembled structures like radio dishes, even food and medicine. As launch costs decline, the value of basic items for trade goes down; at the same time, the cost of imports from Earth also drops. A large colony will be able to beat the capacity of chemical rockets pretty easily and could remain competitive with some kinds of nonpropulsive launch.
It needs saying. A colony relies on the strengths and diversity of its people. These will be self-reliant, adventurous people who also possess caution, curiosity and intelligence. There are some potential moral difficulties involved in choosing the members of a colony like this; population exchange will be low due to the high cost of travel, so there are some legitimate concerns for long-term health of the overall population. A truly independent group will require on the order of 10,000 people, ideally with no known dangerous recessive traits or chronic communicable diseases. If this colony is being created as a lifeboat or to represent humanity then people with potentially dangerous genetic traits should still be included; the minimum population would be increased to compensate but we have genetic diversity for a reason. On the other hand, if it is a private venture done for profit there should be no objection to standards of fitness that go above and beyond Earth standards; we already do that for astronauts and for good reason.