How was the Ammonia replaced by Nitrogen in the Earths early atmosphere?
It is now thought that the Earth’s early atmosphere contained carbon dioxide and nitrogen, and possibly traces of methane and HCN (from photochemical reaction involving CH4 and N2), but that any ammonia would have been broken down photochemically. So, sadly, the Urey Miller synthesis of amino acids probably wouldn’t have worked. Modern thinking suggests that organic material came in by comet (“dirty snowballs”, which is also where much of the water in the earth’s ocean came from), or else by chemical reactions at hydrothermal vents, where strongly reducing magma would have met an ocean extremely rich in dissolved CO2. Incidentally, when you study the Haber reaction, you will learn that ammonia is thermodynamically favoured over N2 + H2, but the reaction has an enormous activation energy barrier because of the bonds that have to be broken.