Different plants get nitrogen through different ways:-
1. leguminous plants or legumes have root nodules. this provide a shelter for a bacteria named rhizobium to live. in return it converts atmospheric nitrogen into soluble form(nitrite and nitrate)so that plants can take it.
2. insectivorous plants fulfill their nitrogen requirement by feeding upon insects.
3. other plants get nitrogen from fertilizers and manures that people add into soil.