Ammonia can be prepared through various chemical reactions, including the reaction of ammonium salts with strong bases, direct synthesis from nitrogen and hydrogen, and hydrolysis of calcium cyanamide.