To simply removed N from air you can use to produce magnesium nitride by heating magnesium metal in a nitrogen atmosphere.
3 Mg + N2 → Mg3N2
In fact, when magnesium is burned in air, some magnesium nitride is formed in addition to the principal product, magnesium oxide.
Alternatively, you may find a very less number of substances which absorb components of air, say some specific organic solvents, but the process is not cost efficient e.g. zeolite.
You can separate nitrogen from air using various ways. The two most commonly employed methods are pressure swing adsorption and membrane separation. Look up the details from Coilson Richardson or Perry's Handbook.