One possible way of deflecting an asteroid is to essentially park a spacecraft next to it and use the tiny gravitational tug to very gradually change it’s trajectory. It changes it only a little bit at a time, but if you have decades of time to work with this procedure will succeed.