If you think about "free riders" versus "cooperators" as a dichotomy, you won't find a solution. Everyone is both a "free rider" and a "cooperator", depending on social context. The issue is that our social fabric itself may be incentivizing people towards long-term destructive patterns.
So, how do we fix it? IMO, the best any one person can do is try to create an environment where people feel safe to cooperate. I believe human nature is fundamentally cooperative in large groups, but we are often "forced" into a competitive track by a lack of resources or other external pressures.
For example, many US workplaces pit employees against each other. It's perceived that there are too many workers for a limited number of jobs, so workers feel forced to compete for their "slot." If there was less communal anxiety about being fired, more individuals would feel comfortable to cooperate with their coworkers instead of competing.
Ofc, this is an insanely complex issue, so that's just a tiny facet, and I'm sure some of the points are debatable. But I honestly believe that "taking care of people" is one of the key ways to achieve more collaboration.