At the beginning of Parshat Matot, God tells Moses to do battle against the Midianites - immediately after which Moses is destined to die.
Now for Moses, this sounds like a real dilemma. He knows that war against Midian will speed the Jews' entry into Israel, but the consequence will be his own death. What does Moses do?
You guessed it - without hesitating, Moses quickly organizes the people for war. This is self-sacrifice taken to the Nth degree. In order to fulfill the wishes of God and advance the national cause, Moses literally hastened his own death.
Now let's look at the other side: what was the Jewish people's reaction to all this? Recall these same people had complained bitterly against Moses for the past 40 years in the desert - even threatening to stone him! But now, the Torah tells us, the people refused to fight the Midianites - so as not to cause the death of their beloved leader Moses. Why the change of heart?
The commentators explain that all those years of criticism were only because the people respected Moses so much and had the highest expectations of him.
It's like when parents criticize a child - it's only because they love the child so much and want the very best for him. Of course the methodology may be wrong, but the sentiment is sincere.
And that's why, with the threat of Moses' death looming before them, the Jewish people were ready to boycott the war, and delay their own entry into Israel, in order to extend Moses' life. In the end, we see that all their complaining was really rooted in love. Remember this the next time ... someone complains about you!