Immanuel Kant’s ethical theory is based around his idea of a Categorical Imperative. That is, moral rules (imperatives) that man must apply in every case (categorical).
He saw the Categorical Imperative as being opposed to a hypothetical imperative. A Hypothetical Imperative is something that tells you what you ought to do if you want to achieve something in the short run. A Categorical Imperative is something which just simply ought to be done. There is no goal in it, it is, according to Kant, the one moral rule to follow.

Kant believed morality had nothing to do with consequences. Rather, it is about the means, and the only moral act, according to Kant, was one performed out of a sense of duty and purely out of a sense of duty. If there was any end in an act for somebody, even if it is the warm feeling one gets after knowing one has done something good for somebody- to Kant, the only moral act was one done with no end in sight for the person performing the act.
Had Kant been alive long enough to know of Utilitarianism, he would have written so much against it, because utilitarianism bases morality totally on consequences, specifically, ‘the greatest happiness for the greatest number’.

The Categorical Imperative is the rule, says Kant, all other moral rules boil down to (if they truly are moral rules). Kant expressed this rule in two major ways, the First and Second formation. The first formation was the Principle of Universalisability and the second formation was Kant’s principle of treating people as ends in themselves and not purely as means. Firstly, he had the rule of Universalisability. That is, in his own words (but, obviously, translated into the English of his day), ‘act only upon that maxim whereby thou canst at the same time will that it should become an universal law’. This would seem fairly obvious to most people.
Put in simpler words, it means no man is special, therefore no man has the right to, say, lie. If one man lied, there’d be maybe some people slightly worse off than before, and it would be harder to trust this one man in future, and communication between the man who lied and the person who listened. But applied to the principle of Universalisability, everybody lying would break the whole of society down. Society is based on communication, hence if communication breaks down, society breaks down, and there would be chaos.

Or take the case of one man committing murder. In the case where it’s just the one man, there is a single tragedy but on a world scale it comes to next to nothing of a tragedy. Applied to the principle of Universalisability, if everybody killed everybody, who would remain on the Planet?

Kant’s second formation of the Categorical Imperative was, in his words but, again, translated into the English of his time, ‘so act as to treat Humanity, in thine own person or that of any other, in every case as an end withal, never as a means only’. This also seems obvious. Put simply, it means to treat people only as means to you end is immoral. People are people and deserve to be treated as ends in themselves. This is not to say Kant didn’t agree with people being used as means to somebody’s end as well as an end in themselves. What this means is not to treat people ‘as a means only’.

So take the example of a fishmonger. He is needed by the people so they may have their fish. Nobody is treating the fishmonger purely as a means to their end of fish. The fishmonger is a human being, an end in himself, but he is needed so the people may eat fish.
But then take the example of, the capitalist exploitation of the working class, the proletariat. The wealthy upper class treat the working class purely as means to their end, their monies. Kant would find this highly immoral, had he lived to see capitalism. Indeed, as would, and do, most people around the world today.