When gas in the atmosphere is turned to ammonia by Rhizobium, which is a bacteria.
The ammonia can then be used up by plants.
Rhozobium root nodules of leguminous.
They form a mutualistic relationship with plants by providing nitrogen compounds and carbohydrates.
When nitrogen compounds from dead organisms are turned into ammonium compunds by decomposers.
Animal waste (ie.urine and faeces) also contain nitrogen compunds.
When ammonium compounds are changed unto nitrogen compounds in the soil are changed into nitrogen compounds that can be used by plants.
nitrifying bacteria eg.Nitrosomonas change ammonium compounds into nitrates.
Other nitrifying bacteria called Nitrobacter change nitrites to nitrates.
When nitrates in the soil are converted into nitrogen gas by denitrifying bacteria, they use nitrates in the soil to carry out respiration.
Happens under anaerobic conditions, eg. in water logged soils.