In this setting humans have settled all around the solar system but the bulk of the population is still in earth however an asteroid wiped out all life. Now can humans sustain themselves with whatever resources are available in space and planets
Your aims are basically mutually incompatible.
If humans have developed the technology and invested the capital needed to let them populate most, if not all of the solar system, even at a relatively low level (compared to Earth) then by default they are more than capable of preventing an asteroid from obliterating life on Earth.
This is because, even if they are limited to the inner system (i.e. the asteroid belt, Mars, the Earth/Lunar gravity well and Venus etc) they must have the technology (think astronomy equipment, rocket drives and manufacturing capacity etc) to intercept any normal orbital body, like an asteroid entering that space before it hits the Earth .
And if they don't? That means they must have deliberately chosen not to. Which means in turn that you then have to come up with some plausible explanation in your plot line for why they didn't intervene when they could have.
And here's the rub - if they choose not to it can only be because they are no longer reliant on the Earth to provide any of the goods or services (think food, medicine, tech or expertise etc) needed to keep the space colonies running. If that's not the case? If they are still dependent on supplies in some form or another from Earth? Then failing to intervene means they commit suicide!
And this holds true BTW even in a scenario where they hate 'Terra' and are effectively at war with all or some of the nations of Earth. They could only afford to deliberately target the Earth for destruction by dropping a rock on it if they were no longer reliant on it to begin with.
In short given your starting conditions there has to be either lots of places in the solar system where they could extract, water/oxygen and minerals and everything else they need survival (which means they are more than capable of stopping a rogue asteroid etc if they want to) or there exists lots of capacity to lift what they can't get for themselves off the surface of the Earth into space. In which case Earth itself could launch an interception mission even if the 'colonies' weren't interested. Either way by default someone has the capacity to stop Earth being destroyed in the first place unless it was an act of war.
It's going to be hard to impossible.
When settling in a new environment, survival is strongly dependent on having supplies from the motherland until the time a sufficiently stable local supply chain has been established, meaning growing food, having water and gathering materials.
Without those elements the local community is very fragile and can succumb to the first harshness.
For a reference, look at European colonies established in the newly discovered continents: until they had established farming, safety and manufacturing, a single harsh winter was enough to wipe them out.
Even if they have a somehow established local food chain, they would still depend on anything that cannot be manufactured locally: if that's critical for survival, they have no hope if they can't produce it in loco.