* Vast distances: Stars are incredibly far apart. The nearest star to our Sun is Proxima Centauri, which is about 4.24 light-years away. That's a distance of roughly 25 trillion miles. Even at the speed of light, it would take over four years to reach it.
* Navigation and course correction: Spacecraft are meticulously designed and navigated. They use advanced technology to plot precise courses and constantly monitor their position, avoiding celestial bodies.
* Space is mostly empty: The space between stars is incredibly vast and empty. There's little chance of a spacecraft randomly encountering a star without careful planning.
* The dangers of stars: Stars are massive balls of burning gas with immense gravity. Approaching a star is incredibly dangerous, and any spacecraft would be vaporized long before reaching it.
In summary: Spacecraft are built to avoid celestial bodies, and the sheer vastness of space makes collisions with stars incredibly unlikely.