What did the Earth need to become habitable?
It needed to be close, but not too close to a star. Water. A rocky surface. An atmosphere.
There's one more thing that's a little easier to forget. A magnetic field. Scientists believe Earth's magnetic field kept its atmosphere safe from the Sun when it was younger and more violent. Without a magnetic field, Earth would have lost most of its atmosphere.
Kappa Ceti
Scientists use Kappa Ceti, a star that at four hundred to six million years old, is approximately the same size and age of our sun when life first appeared on Earth. That star is extremely magnetically active. It propels plasma into space on stellar winds that are fifty times stronger than the solar winds from our sun. There are also starspots--like sunspots on our sun--that are all over its surface.
Models showing the effects of those strong winds on a young Earth found that the planet's protected region, the magnetosphere, would be a third to half as big as it is today. So there would be less protection, but still enough of it to keep the atmosphere intact.
What if Earth didn't have a magnetic field? A good comparison is Mars. Without a protective magnetic field, that planet lost most of its atmosphere. Where there was once many briny oceans, now there is only cold deserts.