How to Make Sure a Spacecraft Survives Its Journey
When a probe is fired off into the vastness of space, suffice to say that it doesn't reach its destination quickly. It's a long voyage, and space is never empty enough for the the craft to be completely safe.
NASA can never completely be sure that a spacecraft will reach its destination, whether it's Cassini's trip to Saturn, Juno's trip to Jupiter, or the Dawn Spacecraft's trip to Ceres. But since all those probes did indeed reach their destination, they have a pretty good track record, and there's several reason for that.
According to Seeker, NASA has a handful of different strategies for dealing with various space troubles. The biggest threat to most spacecrafts, both literally and figuratively, is the cosmic debris littered throughout our solar system, which can travel at high speeds and can't easily be tracked. According to NASA's Nicholas Johnson:
There's no surefire way to keep the probe safe — if an asteroid catches one off guard, there’s not much we can do from Earth — but protecting the most important parts of the probe is possible. The Hubble Space Telescope, for example, is rotated on its side whenever it's approaching (or being approached by) a meteor shower, to make sure the crucial solar panels stay safe in case Hubble takes a beating. Even with no one onboard, nobody wants a Gravity scenario striking Hubble.
Less flashy ways that a probe could die off include the bitter cold of space and the high amounts of radiation, both of which are painful ways for a human to go out, and can cause similar damage to the objects we send out there. Temperature troubles can be solved fairly easily, with things like the thermal louvre on the ESA's Rosetta, which look vaguely like window blinds that trap or release heat to control how hot the probe gets.
Radiation is more complicated, and there's a greater risk of crucial pieces of the spacecraft getting fried this way, especially if the probe is approaching a star, like the Parker Solar Probe that NASA's about to send into the sun's outer atmosphere.
Another workaround is crude, but works really well: engineers sometimes put duplicate parts in the spacecraft, in case one goes down. This is part of why Voyager 1 has tons of backup thrusters, some of which only just fired up after decades of idleness. The other reason for those spares is to protect the probe against the passage of time, as keeping every piece of a probe in functioning condition can be difficult when you’re planning a mission that spans several years (or forty years, in Voyager's case).
Or, NASA sometimes takes the opposite route of Voyager 1 and instead goes for the Cassini method: crashing the probe in a controlled, fiery death before it potentially malfunctions in a hazardous or inconvenient way. In those cases, the spacecraft dying on NASA's terms is about all they can hope for. It's tough to keep a probe alive in space.
The Cassini probe recently destroyed itself by crashing into Saturn, managing to pick up some last-minute data about the ringed planet without potentially contaminating Saturn’s moons by landing on a rocky surface where hitchhiking Earth germs could survive and possibly spread.
In those cases, it's not ideal, but not every probe gets to live as long as Voyager 1. Thankfully, Cassini was still active for ages, and many probes can last for a long time in the cold, debris-filled radioactive final frontier.