Yes, pure capitalism and pure socialism are the extremes that could never work. The "perfect" solution cannot exist, however, the best result is by mixing the two ideologies together. And not to brag, but that's how a lot of European countries work out... A free market, and yet still some social safeguards, like a regulate health care, payments to unemployed and those unable to work due to medical reasons, and stuff like that.. well, that's the simplistic version, as the real thing is a lot more complicated than that, I can assure you. And also some rules about how employers treat their employees... You can't fire employees too easily in Europe, unless you have a good reason for that, well that's the simple version.
I'm not saying this system is perfect. Far from it. It has many cons, and the character limit does not allow me to start naming them, but yet in general it appears to work. "Right" (capitalism) and "Left" (socialism/communism) will never work without the other. Going too far to the right will bring trouble and left can help to keep it in control. However vice versa is also true. The same goes for progressive politics and conservatism (which have nothing to do with left or right. Leftist conservatism DOES exist).
Moderation is the key to everything.