Capitalism and socialism is a false ideological dichotomy. Mr. Beat has a good video on this. We live in a mixed economy.
Not to fall into the "communism is when free stuff" trope, but...
Most people like public schools, public roads, public transit, public parks, and public libraries.
The benefits of public goods are well known. This is the whole field of public finance economics.
Market failures are also well-known. Negative externalities, moral hazard, adverse selection etc. Hence carbon taxes, congestion charges, and universal healthcare.
In other words, sometimes free trade capitalism works, other times it doesn't, and it's not a mystery when. Marx's whole spiel about contradictions is wrong and largely throws the baby out with the bath water, so to speak.