Nitrogen is removed through the biological oxidation of nitrogen from ammonia to nitrate (nitrification), followed by denitrification, the reduction of nitrate to nitrogen gas. Nitrogen gas is released to the atmosphere and thus removed from the water.
Nitrification itself is a two-step aerobic process, each step facilitated by a different type of bacteria. The oxidation of ammonia  (NH)  to nitrite (NO) is most often facilitated by bacteria such as Nitrosomonas spp. (nitroso refers to the formation of a nitroso functional group). Nitrite oxidation to nitrate (NO), though traditionally believed to be facilitated by Nitrobacter spp. (nitro referring the formation of a nitro functional group), is now known to be facilitated in the environment predominantly by Nitrospira spp.
Denitrification requires anoxic conditions to encourage the appropriate biological communities to form. Anoxic conditions refers to a situation where oxygen is absent but nitrate is present. Denitrification is facilitated by a wide diversity of bacteria. The activated sludge process, sand filters, waste stabilization ponds, constructed wetlands and other processes can all be used to reduce nitrogen. Since denitrification is the reduction of nitrate to dinitrogen (molecular nitrogen) gas, an electron donor is needed. This can be, depending on the wastewater, organic matter (from the sewage itself), sulfide, or an added donor like methanol. The sludge in the anoxic tanks (denitrification tanks) must be mixed well (mixture of recirculated mixed liquor, return activated sludge, and raw influent) e.g. by using submersible mixers in order to achieve the desired denitrification.
Over time, different treatment configurations for activated sludge processes have evolved to achieve high levels of nitrogen removal. An initial scheme was called the Ludzack–Ettinger Process. It could not achieve a high level of denitrification. The Modified Ludzak–Ettinger Process (MLE) came later and was an improvement on the original concept. It recycles mixed liquor from the discharge end of the aeration tank to the head of the anoxic tank. This provides nitrate for the facultative bacteria. 
There are other process configurations, such as variations of the Bardenpho process. They might differ in the placement of anoxic tanks, e.g. before and after the aeration tanks.