Earth seems like a troubled place right now, but at least our cosmic surroundings appear peaceful. But this is not universally true, as explosions, collisions and other dangers lurk in other places and times.In our new research, published in Monthly Notices of the Royal Astronomical Society, we scoured simulated universes to find the friendliest locations for life.We discovered something reassuring: the Sun, sitting here in the outskirts of the Milky Way galaxy, is about as good as it gets.The Goldilocks zonesRegions of the universe that would be friendly towards life are known as habitable or Goldilocks zones – they’re just right.Whether life is actually there is another question. As astronomers and biologists explore how life could form on exoplanets (planets outside the Solar System), astrophysicists follow the structure and evolution of the universe to identify the nicest places, as well as those where life could be snuffed out in an instant.So, where should we look for life?For example, there is a Goldilocks zone in the immediate neighbourhood of stars. Too hot or too cold will not do. This “circumstellar habitable zone” is just right for liquid water instead of steam or ice. The circumstellar habitable zone near a star is ‘just right’ – not too hot, not too cold. NASA Zooming out, we can look for the nicest places and times to live in our own Milky Way galaxy. A young star that’s too close to the galactic centre will suffer in the hustle and bustle of all the nearby stars, whilst stars that are too far away will be in a sterile environment, devoid of the chemicals essential for life.Just as Earth is in the Sun’s circumstellar habitable zone, the Sun is in the Milky Way’s “galactic habitable zone”.Let’s zoom out even more. What about other galaxies?Simulating the universeWe followed synthetic galaxy evolution using the EAGLE (Evolution and Assembly of GaLaxies and their Environments) project – one of the most realistic simulations of the observed universe.They track the expansion of space, gravity’s pull, and the physics of gas, stars and black holes, and provide us with a detailed map of what the universe looks like across hundreds of millions of light years.With such a map, we asked: where might life be most welcome? Finding life, avoiding catastrophesWith no observations of alien life, we must make assumptions. The hydrogen and helium produced in the Big Bang are too simple to make organisms, so we focus on generations of stars that have seeded the cosmos with heavier elements essential for life.Exoplanet observations reveal that Earth-like rocky planets require a certain concentration of those heavier elements. However, too much could produce a hot Jupiter, a gas giant that sweeps through the planetary system, eating rocky planets on the way. This is best avoided.Our breakthrough involves detailed modelling of those things that are bad news for life. Big stars blow up, sterilising their local environment. Bigger explosions, such as gamma-ray bursts, can fry a much larger volume. Palaeontologists think that the Ordovician mass extinction 450 million years ago might have resulted from a nearby explosion.There are other dangers to avoid. We wouldn’t want another star to wander through our Solar System and disrupt Earth’s nicely circular orbit. So, steer clear of crowded galactic neighbourhoods.Then there are the black holes. Most of these are small and don’t pose any danger, but in the hearts of galaxies lurk monsters. Weighing more than a million suns, these can roar into life as they swallow matter that gets too close. So, stay away as this can result in intense radiation that can strip the atmosphere off your planet.A home among the galaxiesWhile we don’t know if life would form in these nice spots, they are the ones that offer the best conditions.And the results tell us another thing: the Milky Way is rather nice.This isn’t just a fondness for our own neighbourhood. We could have found that life should exist in earlier galaxies, smaller ones, or farther from galaxy centres.We find that our universe has created plenty of opportunities for habitation, though it seems to be slowing down as the rate of catastrophes catch up with the creation of new planets. Our Milky Way seems typical in the galaxies that have been efficient in turning the raw materials of the cosmos into life-friendly environments.Similarly, the Milky Way, and its kindred, have put their energetic and dangerous days behind them and settled into a relaxed retirement. These days, even in a billion years of wandering around our Milky Way, less than one star in a thousand would experience an extreme, life-annihilating extinction event.The story is different for smaller galaxies, which are far more numerous than the Milky Way, as they are too crowded and too energetic.So, rest easy. And if you get the chance, buying a property in the Milky Way is probably a secure investment, astronomically speaking.Geraint Lewis receives funding from the Australian Research Council. Luke Barnes and Miroslav Filipovic do not work for, consult, own shares in or receive funding from any company or organisation that would benefit from this article, and have disclosed no relevant affiliations beyond their academic appointment.