Well someone has already proposed something similar, using infrared. After all all light is electromagnetic radiation. So anyway Philip Lubin (of UC Santa Barbara) talks about it here.
So his idea is to build a modular infrared phased laser array, powered entirely by solar power and focus the output on your NEO. You can use phasing to focus the infrared on the target.
The easiest targets would be comets as they evaporate at between 20 C and around 200 C. To evaporate stony or metallic meteorites you'd need thousands of degrees. You would target them during a close flyby of Earth, which they normally will do before they hit. With a smaller meteorite you can evaporate it completely (which is why I'm including it here in this section on destroying the meteorite). Since the array is modular, then as you build it larger, you can evaporate larger meteorites.
You can also use it to focus energy on part of the meteorite, creating a jet of evaporates that can propel the meteorite.
This image from his talk illustrates the idea.
He proposes systems of various sizes from desktop sized to kilometers in diameter. The ten kilometer one could deposit 1.5 megatons of energy a day on the target and just obliterate the asteroid from a great distance, California Scientists Propose System to Vaporize Asteroids That Threaten Earth
But to deflect an asteroid, he calculates that a 20 kW device could do it, if it travels alongside the target deflecting it from nearby
“As one example, consider a typical 325 m asteroid: beginning 15 yr in advance, just 2 N of thrust from a ~20 kW stand-on DE-STARLITE system is sufficient to deflect the asteroid by 2 Re [radius of Earth]. Numerous scenarios are discussed as is a practical implementation of such a system consistent with current launch vehicle capabilities.”
[1601.03690] Orbital Simulations on Deflecting Near-Earth Objects by Directed Energy
List of some of his publications here: DE-STAR
There are many other ways to deflect an asteroid. Direct kinetic impact could work for many, even without nuclear weapons. Also with so many asteroids out there, often you can find another asteroid on a similar enough orbit that you can hit the smaller one and deflect it to hit the larger one creating a multiplier effect.
It all depends on how long in advance you know about he impact.
If you know about it over 10 years in advance, you just need to change the velocity by a little more than the speed of a fast moving snail. And if it does a flyby of Earth first - as would often the case indeed if you have detected it long in advance, say a couple of decades in advance, then it has to go through a narrow “keyhole” perhaps 200 meters in diameter first to hit Earth next time around. In that case, you just need to deflect it with a delta v of order 0.1 cms per hour to miss the keyhole a decade later, and even with only one year before the flyby, you only need to deflect it by of order 1 cm per hour to miss the keyhole.
See also my Giant Asteroid Headed Your Way? - How We Can Detect And Deflect Them which goes over some of the other ways of deflecting asteroids.