How do we spot a comet or asteroid if it does not emit light or pass infront of an object which emits light?
And if such an object would be on a crash course with our planet how early would we be able to spot it?
Yeah.. You're right that those objects don't emit light. But, they can scatter electromagnetic waves. So, we can study almost many properties like size, shape, average diameter, etc. through RADAR
Radar is the first step of the Cosmic distance ladder which can be used to locate such objects and study about their physical properties. I think it's limited to our solar system. That's why we go into Parallax measurement for browsing deeper into our galaxy...
One of the coolest things you can do to find "dark" objects like those is to use the Goldstone Solar System Radar. It's like a conventional radar system, but used on earth pointing into space, which is double awesome!
NASA webpages published images of asteroids which will pass earth around 2030 (hello, Aphophis) somewhere in the early 2000's, so I guess ten years in advance seems a reasonable timeframe, given the object is big enough.