Where did the nickel in the Earth's core come from? Why is there nickel in the core of the earth? Does it come from collisions of two neutron stars? And how did we know the core of our planet is made of nickel-iron alloy? Thank you.
Nickel is formed in supernovae.
There are several different types of supernova.  Wikipedia suggests that about 70% of nickel was formed in exploding white dwarfs, and 30% in explosions of massive stars.  Unlike say gold, merging neutron stars do not produce a substantial proportion of the nickel on Earth.
We know about the composition of the core by Earth Science techniques (studies of Earthquake waves that pass through the core tell us about its density, we also know about the mass of the Earth, and these are all consistent with an iron-nickel core)  And from meteorites.  Metallic meteorites have come from the cores of disrupted asteroids, and these asteroids formed at the same time as the Earth. They are made of the same mix of iron and nickel.