You need to block about 0.3% of the sunlight hitting the Earth to counteract global warming.
About 80,000 km of mylar at L1 would do it.
On Amazon, that much mylar would cost you on the order of $100B and weigh 7 million metric tons; SpaceX would charge around $40T at today's prices to lift it to orbit.
Obviously it's more complicated than that, and that solution is potentially unworkable for a variety of reasons, but that's roughly the scale of the problem.
There are all sorts of ways that the resources and energy available in space can make the scale of these challenges more feasible. I don't expect that is we will see those benefits for several decades at a minimum as we are a long way from industrializing space at the scale necessary for it to matter.
In the short term the only practical benefits we can expect to see is cheaper satellites that will help use understand how the planet is changing as it heats up.
I don't think that working to towards colonization of mars and working to counteract global warming are antithetical or even orthogonal.