Both Marx and Engels considered class struggle as a tool to overthrow the capitalists. This struggle can be achieved in various ways from minor (strikes) to major (civil wars).
Marx analysed how new classes have become ruling classes throughout history, by violently overthrowing older classes (ex. in French revolution, where Capitalists overthrew the old Feudal lords). This process will inevitably lead, according to Marx, to the final revolution, where the oppressed class in all history (workers, farmers, etc. the proletariat) will overthrow the ruling class, implement the dictatorship of the proletariat and gradually abolish class inequities, leading to a classless society.
The different momenta of primitive accumulation distribute themselves
now, more or less in chronological order, particularly over Spain,
Portugal, Holland, France, and England. In England at the end of the
17th century, they arrive at a systematical combination, embracing the
colonies, the national debt, the modern mode of taxation, and the
protectionist system. These methods depend in part on brute force,
e.g., the colonial system. But, they all employ the power of the
State, the concentrated and organised force of society, to hasten,
hot-house fashion, the process of transformation of the feudal mode of
production into the capitalist mode, and to shorten the transition.
Force is the midwife of every old society pregnant with a new one. It
is itself an economic power.
Karl Marx. Capital Volume One, Chapter Thirty-One: Genesis of the Industrial Capitalist
However, in how the proletariat should strategize its revolution, Marx & Engels did not deny a peaceful revolution, when this is possible.
Will the peaceful abolition of private property be possible?
It would be desirable if this could happen, and the communists would
certainly be the last to oppose it. Communists know only too well that
all conspiracies are not only useless, but even harmful. They know all
too well that revolutions are not made intentionally and arbitrarily,
but that, everywhere and always, they have been the necessary
consequence of conditions which were wholly independent of the will
and direction of individual parties and entire classes.
But they also see that the development of the proletariat in nearly
all civilized countries has been violently suppressed, and that in
this way the opponents of communism have been working toward a
revolution with all their strength. If the oppressed proletariat is
finally driven to revolution, then we communists will defend the
interests of the proletarians with deeds as we now defend them with
Frederick Engels 1847 The Principles of Communism
You know that the institutions, mores, and traditions of various
countries must be taken into consideration, and we do not deny that
there are countries -- such as America, England, and if I were more
familiar with your institutions, I would perhaps also add Holland --
where the workers can attain their goal by peaceful means. This being
the case, we must also recognize the fact that in most countries on
the Continent the lever of our revolution must be force; it is force
to which we must some day appeal in order to erect the rule of labor.
The International Working Men's Association, 1872 La Liberté Speech