How does a nuke work and where was the first test?

According to this infographic for an atomic bomb to explode, a chain reaction must start. To start the reaction uraninum-235 must be loaded and fired causing heat and igniting the gunpowder which doing so releases plutonium and poisoning the area. The first test had a code name of Trinity and took place in Alamogordo, New Mexico on July 16, 1945, at 5:29:45 AM. To do this the government kicked out locals and spent billions creating facilitys for testing.