

you can’t turn a gas into liquid by compression alone if temperature is above critical point, you also need to cool it down. separation is done by fractional distillation, but the reason it’s done is mostly about oxygen (medical and steelmaking among some other uses). for nitrogen it’s somewhere about -150C. first air is stripped of water and carbon dioxide, then it’s turned into a liquid, then it’s separated into oxygen, nitrogen and argon, and some large specialized plants also separate xenon, krypton and neon
if you don’t actually care for it being a liquid, there’s another method called pressure swing adsorption that separates gases based on how tightly do they bind to porous surfaces under pressure. this is how medical oxygen concentrators work
making liquid nitrogen is pretty efficient these days, as in not much more energy is used than is actually needed


the waste heat comes from cryogenics system that keeps all of this helium at below 3K. turns out you need to spend a lot of energy to cool down things to temperatures this low