As far as I can see, you have the following posibilities:
A. Object is so large, you get off Earth if you can: e.g., Mars or Ceres Very unlikely.
B. Object is of such a size that avaodance measures are plausuble e.g., gravity attraction, Yarkovsky Effect
C. Object large enough to seriously damage urban area, but smaller than B. Conssider splitting.
D. Object will only give meteor or small meteorite. No action. Fortunately the majrity of Earth is covered with water or non-habitable areas e.g., desert. Smallish impacts may hit there - no problem. Larger asterpoids, even hitting sea or desert could cause a "nuclear winter" or other such worldwide problem.
The case I have the most problem with is B. It is easily forgotten that such asteroids can be coming at Earth at dizzying speeds:
ASTEROID 2020 ND EXPECTED TO PASS EARTH AT DIZZYING SPEED OF 48,000 KMPH AT 8.43 PM (my emphasis). Remember we have to spot such an asteroid, which may be approaching at 48,000 kph. We get there and stop. We paint it to take advantage of the Yarkovsky effect and wait ten years for it to have enough effect. Or we fly a rocket to nuke it, and again it has passed Earth before we reach it.
The good news is that the dificulties of asteroids coming "out of the Sun" can be overcome by having space telescopes sufficiently distnced from Earth.
I would be very happy if anyone can calm my fears over object type B above.
Cat