See Communism
The best way for Capitalism to avoid Communism is to implement Socialist reforms to improve economic justice.
Communism has been tried and it did not succeed in producing a happier society.
A mixed economy has produced the best historical outcomes for wealth and happiness.