In Thor: Ragnarok, many Asgardians are killed; all surviving members of the race that we know of escape on a space ship. At the start of Avengers: Infinity War we see that they were almost immediately intercepted by Thanos, who slaughters many and blows up their ship. In Avengers: Endgame, it is confirmed that Thanos had slaughtered half their population (as we know had been his practice) and we see the survivors in their new settlement in Norway on Earth.
How did any of them survive the destruction of their ship? How did they get to Earth?