When we breathe, we focus on the oxygen, but oxygen makes up only a small slice of the air. Earth’s atmosphere is mostly nitrogen - about 78% - with oxygen being just the next-biggest piece at 21%. Argon and other trace gases make up the remaining 1%, including the small but important amount of carbon dioxide that drives the greenhouse effect.
Nitrogen is essentially inert. We breathe it in, our body doesn’t do much with it, and we breathe it back out. It dilutes the oxygen, making the air safer to breathe (pure oxygen at sea-level pressure would damage your lungs). Animals like fish actually have to filter dissolved nitrogen out of water through their gills carefully - too much in their blood and they get the bends, just like deep-sea divers.
Oxygen wasn’t always abundant on Earth. For the first 2 billion years of Earth’s history, there was almost no oxygen in the atmosphere. Then, around 2.4 billion years ago, photosynthesizing bacteria evolved and started pumping out oxygen as a byproduct. It built up over hundreds of millions of years, eventually triggering massive extinctions of organisms that couldn’t tolerate it. The atmosphere we breathe today is basically pollution from those ancient bacteria - and it’s what made big, energy-hungry animals like us possible.