The question now becomes how the Avengers learn of this and which members will be heading into the cosmos.
If Thanos attacks Earth first, having the remaining heroes travel to the cosmos and then encounter the Guardians makes sense.
Instead of Thanos’ attack possibly being largely based on Earth, it could be the intergalactic threat that brings the Avengers into a fight the Guardians are already taking part of.
They could be distractions as Thanos rounds up the Infinity Stones and then moves across the galaxy, leaving destruction wherever he roams.