I believe the answer is: In the novel, Don Quixote fights windmills that he imagines to be giants. Quixote sees the windmill blades as the giant's arms.
Knowing that this is just Don Quixote's delusion, Sancho tried to talk some sense into Don and make him see the reality.
Even though this might seen as something comedic by other people, if we judge from Don Quixote's own perspective, we can see that his action is based on chivalry to fight a being that is way stronger than him.