A number of methods have been proposed over the years including the famous one of sending nuclear-tipped rockets to explode either next-to, or inside the surface of the approaching body. Also, laser beams reflected from orbiting mirrors have been proposed to heat the surface of the body and provide a 'jet' of gas to act as a rocket on the body itself. Despite many technical and dynamical studies, no one really knows what the optimal method would be for a body of a given mass. Much depends on how much warning is available, and whether the strategy should be to pulverize the object, or to gently divert its course with a 'mid-course' correction.
The biggest problem is determining which size of bomb is appropriate for a comet or asteroid of a particular composition and mass, and where to explode the bomb. If the explosion is delivered right to the surface, too small a blast will dig a crater and not provide enough course change if the comet/asteroid is detected too late. Too big an explosion will break the body into many separate ones, each capable of its own destruction if it continues on a collision course with Earth. In the later case, some argue that if the individual pieces are small enough, they will burn up in the atmosphere before impacting on the surface. But there is a critical mass threshold below which you have to pulverize the main body for the new pieces not to pose a secondary threat.
One problem we can anticipate is that, as Comet Hyakutake has shown, we may only get a few weeks notice between discovery and closest approach or collision, at least for cometary objects a kilometer or so in size. There are no convincing examples of a comet actually impacting the surface of the Earth, so perhaps the damage done by such objects is not substantial. Asteroids, however, are another matter. The Meteor Crater in Arizona would have devastated any major metropolitan city, and was caused by an asteroid less than a few hundred meters across. Such objects would be almost undetectable until a few days before impact.