Bacteria on the roots of legumes fix nitrogen, converting it to a form usable by plants and animals. Photo courtesy of CIAT/Flickr.
The nitrogen cycle starts in the atmosphere, and it involves the element nitrogen cycling through Earth's spheres. Remember, our atmosphere is 78% nitrogen. But, it is a type of nitrogen that is not usable by organisms (and if you remember back to last semester, nitrogen is one of the essential ingredients for life on earth). So, the first step in the nitrogen cycle is nitrogen fixation. That is the process that takes the nitrogen in the atmosphere and turns it into a form that is useful to plants & animals. One way this is done is by lightning; lightning changes nitrogen in the atmosphere into nitrites & nitates which can be use by organisms (it is also a common ingredient in fertilizers). This is called nitrification. And the second way is bacteria (in the soil and on plants' roots), which change atmospheric nitrogen into ammonium (in a process called ammonification), which is also used by plants and animals. Then, when plants and animals die, the bacteria break down the ammonia in their bodies (and in their wastes) and put that nitrogen back in the soil so other living plants/animals can reuse it. They basically recycle nitrogen! They also can change nitrogen in the soil back into the type of nitrogen that is found in the atmosphere (as a gas). This is denitrification. Now, you're right back where we started, with nitrogen in the atmosphere!
The phosphorous cycle involves the movement of the element phosphorous from Earth's geosphere to the biosphere & hydrosphere and back again. Most of Earth's phosphorous is found in rocks. When the rocks undergo weathering and erosion, the phosphorous can get transported to the soil and water. Plants in the water and soil can take in that phosphorous and use it to build tissues, bones, teeth, etc. When animals eat those plants, that's how they get their phosphorous. Phosphorous is added back to the soil via animal waste and in the bodies of organisms when they die. Decomposers (bacteria) break down the phosphorous and leave it in the soil in a form that can be reused by living plants. And, if the phosphorous is buried for a long time, it can be compressed into a rock and the whole cycle starts over again!