This answer ends with a four step method to return to Earth from any distance less than one hundred million light years making four jumps through space.
The average, typical region of space within our galaxy is in interstellar space a few light years from the nearest stars.
The average, typical region of space within our universe is in intergalactic space a few hundred thousand light years to a few tens of millions of light years from the nearest galaxies.
So it is a big deal whether the random jump had a maximum distance of about 10,000 light years or 100,000 light years and the spaceship will remain within at least the outer halo of our galaxy, or if the random jump could take the space ship to anywhere in the universe.
If a random jump could be 10,000,000 light years as easily as 10 light years, or 5,824,671,289 light years as easily as 5.824671289 light years, or 428,183,529,744,613,452 light years as easily as 42.8183529 light years, the crew will very probably never find their way home again.
Since the known universe has a border that no light from beyond has ever reached Earth, astronomers have never detected any objects beyond that border, which is believed to be 46,000,000,000 light years from Earth now due to the expansion of space.
But the actual physical universe can extend far beyond the farthest limit of the known universe, and could easily be tens, hundreds, thousands, tens of thousands, hundreds of thousands, millions, tens of millions....etc., etc. times as wide as the known universe. The physical universe could be infinitely larger than the known universe.
So if the random jump could jump to anywhere within the physical universe, the most probable type and vast majority of random jumps would be to some location that is far beyond any astronomical bodies mapped by Earth, a jump to a place where it is totally impossible to find the way home.
E.E. Smith's science fiction novel Skylark of Valeron (1934) put the protagonists in a similar situation, but most real or science fictional space travelers would not have the super advanced technology and resources that the protagonists had to use to eventually find their way back to Earth.
Therefore, it seems necessary that the required jump energy, or the programming of the computers, or some other factor, puts a limit on how many thousands or millions of light years the ship can jump in a random jump. Otherwise the crew will be lost forever and have to make a new home in some unimaginably distant region of space.
So if there is a reasonably short limit, maybe thousands or millions of light years, on the length of a random jump, the characters will be able to find our Milky Way galaxy if they are outside of it, and find their way around our Milky Way galaxy once they return to it.
They would have to scan all 360 degrees of space around them for the brightest objects in various wavelengths of electromagnetic radiation. I guess that about 10 objects in each of the wavelengths chosen should be enough.
In Earth's location close to the Sun, the Sun is the brightest object in most wavelengths.
In radio wavelengths, the Sun is usually the brightest or second brightest object. In interstellar or intergalactic space far from a star, the brightest radio source would not be the nearest star. Planets like Jupiter would not be among the bright radio sources in interstellar or intergalactic space far from the nearest planet.
The first radio source to be detected, and thus one of the brightest as seen from Earth, is Centaurus A, the region at the center of the Milky Way Galaxy. By definition, the Sun is one Astronomical Unit, or AU, from Earth. A parsec is a distance of 206,264.806 AU, and Centaurus A at the center of the Milky Way iss over 8,000 parsecs (or about 26,400 light years) from Earth, or 1,650,000 times as far away as the Sun, but is of similar brightness in radio wavelengths.
Another very early and very bright radio source was Virgo A, which turned out to be galaxy M87 or NGC 4486, about 16,400,000 parsecs (about 53,500,000 light years) from Earth.
The Sun, the Moon, and several planets appear brighter in visible light than any stars as seen from Earth. In interstellar space no planets would be visible and the brightest objects visible would be various stars.
As seen from Earth, the 10 brightest stars are Sirius, 8 light years distant, Canopus at 310 light years, Alpha Centauri at 4.4 light years, Arcturus at 37 light years, Vega at 25 light years, Capella at 42 light years, Rigel at 860 light years, Procyon at 11 light years, Achernar at 140 light years, and Betelguese at 640 light years.
Since those stars have similar apparent magnitudes, but vastly different distances, they must have vastly different absolute magnitudes for some to appear among the brightest stars at distances up to a hundred times those of others.
Here is a method to get back to Earth in a few jumps from a position less than 100 million light years from Earth.
Step One:
If the space ship jumps to a position less than one hundred million light years from Earth, it should be possible to identify various nearby galaxies including the Milky Way galaxy. By measuring the angles to the various centers of three or more galaxies and comparing them to the angles to their centers as measured from Earth, they can calculate how far they are from the Milky Way and Earth's small region of the Milky Way.
Thus they should be able to make a jump that takes them directly to the approximate region of the Milky Way Galaxy where Earth is.
Step Two:
There are over a hundred globular star clusters orbiting the center of the Milky Way galaxy. If they jump into the approximate region of the Milky Way galaxy where Earth should be, they can try identifying at least three globular star clusters and measuring the angles to them. By comparing the angles to them and comparing it to the angles to those clusters as measured from Earth they should be able to calculate a much smaller approximate region where Earth should be and make a jump into that much smaller region.
Step Three:
Detect the brightest stars by apparent magnitude visible from the new position of the ship. Take the spectra of the brightest stars and compare them to the spectra of the brightest stars as seen from Earth looking for matches. Many of the brightest stars will be comparatively dim stars that only appear bright because they are close to the position of the space ship. But some of the brightest stars as seen from that position will have high luminosity and will be among the brightest stars as seen from distances of hundreds and thousand of light years.
The list of the 92 brightest stars as seen from the Earth includes some very distant stars. Naos is 1,100 light years from Earth, Sadr is 1,500, Wezen is 1,800, Alnilam is 2,000, Aludra is 2,000, and Deneb is 2,600 light years from Earth. So since the spaceship should be fairly close to the Sun by now, some of the stars that appear brightest from the spaceship's position should be among those that appear brightest as seen from Earth.
By measuring the apparent magnitudes of those stars and comparing them to the absolute magnitudes of those stars, they can calculate the distances to those stars. Doing that for only three stars will be enough to calculate their position and compare it to the position of Earth. They can also calculate their position, and the position of Earth, from measuring the angles to three or more stars that are among the brightest as seen from Earth.
They should also be close enough to identify the star Aldebaran, 65 light years from Earth, the Hyades star cluster, 150 light years from Earth, and the Pleiades star cluster, 440 light years from Earth. As seen from Earth Aldebaran, the Hyades, and the Pleiades are almost lined up, so a line from the Pleiades through the Hyades and Aldebaran will point almost directly to Earth.
So they make another jump that should take them to just a few tens of light years from Earth.
Step Four:
Once they are within a few tens of light years from Earth, identify the stars that appear brightest from their new position and match their spectra with the spectra of the brightest stars as seen from Earth. There should be a great overlap between the two sets. Identifying three stars should be enough to calculate the position of the space ship and the position of the Sun. Take the spectra of the star that is at the calculated position of the Sun, check to make sure it matches, and then calculate a jump back into the Solar system.
So four steps should be enough to take the spaceship back to the solar system from anywhere within a hundred million light years. And with superior navigators and equipment, or if the ship jumps to a location much closer to Earth, the number of steps and jumps to return to Earth should be smaller.