According to UC Santa Barbara, liquid nitrogen is so cold because its boiling point is minus 320 degrees Fahrenheit. Nitrogen is a gas at room temperature, so a prerequisite for it to be in liquid form is for it to be incredibly cold.
As Brain Stuff explains, liquid nitrogen is commercially produced through a process discovered by Carl von Linde in which gaseous nitrogen is first pressurized with a compressor. Then the nitrogen is released through an orifice, causing it to cool as it expands. This cool gas is then used to cool the nitrogen before it flows into the orifice (known as a counter-current heat exchanger). Eventually, the gas coming out of the orifice is so cold that it turns into liquid nitrogen, which can then be collected and kept in a highly insulated container.