The collision between the Andromeda Galaxy (M31) and the Milky Way is indeed expected to occur in the future, but it is important to note that the actual event is predicted to take place approximately 4 billion years from now. Given the vast timescale involved, the precise positioning of celestial objects, including Earth, cannot be accurately determined at this point.
During the anticipated collision, the two galaxies will interact gravitationally and eventually merge to form a new, larger galaxy often referred to as Milkomeda. Due to the vast distances and velocities involved, the exact details of the collision and which side of the Milky Way will be affected first are uncertain.
However, it is highly unlikely that the collision will have a direct impact on individual stars or planetary systems like our solar system, including Earth. The vast distances between stars and the relatively small sizes of these celestial objects make the chances of any actual physical collisions or disruptions quite rare, despite the galaxies merging.
It's important to understand that the collision of galaxies is a slow process that occurs on a cosmic timescale, and the effects on individual celestial objects within the galaxies are relatively minimal.