If NASA were to use nuclear power, there are four effective ways to try to get the asteroid off course. A surface explosion, a delayed surface explosion, a subsurface explosion, and an explosion where the bomb does not touch the asteroid.
The best option for a non-nuclear defense plan is a series of kinetic impacts. This is basically just ramming things into the asteroid until it's path is changed to avoid hitting earth. Other ways are using a laser or a huge mirror to focus energy on the surface of the asteroid to try to break off pieces of it.
My favorite plan that NASA came up with was the subsurface nuclear explosions, because that is what they tried to do in the movie. Except NASA would use it to try to move the asteroid off course instead of breaking it in half, like what they did in the movie. Nuclear weapons are the only thing that would provide the amount of energy needed to divert an asteroid of that size. NASA proposed the Hypervelocity Asteroid Intercept Vehicle (HAIV). This would create a crater on the surface of the asteroid where the nuclear bomb would be detonated after.
Using this, they would be able to neutralize an asteroid that is 1,000 feet across if they know about it at least 30 days in advance.
This would create enough energy to hopefully change the asteroid's velocity, pushing it away from the earth. You would need megatons of energy in order to achieve this.
Unfortunately, due to Article IV of the Treaty on Principles Governing the Activities of States in the Exploration and Use of Outer Space, including the Moon and Other Celestial Bodies, detonating nuclear weapons in space is illegal. But maybe NASA could try and change some minds if the fate of the planet was in jeopardy.