A Categorical Imperative is considered by
Kant to be a maxim that would be followed by any rational being. There is no "if" involved, they simply are ends in themselves. These imperatives should be followed simply because they are
duties. They are a reason for action.
The best known of the Categorical Imperatives are three included in the summary of Kant's Groundwork. H. J. Paton translates them as follows (the comments are my own) -
1. Act as if the maxim of your action was to become through your will a Universal law of nature.
This is known as The Formula of the Law of Nature. It is basically saying that we should attempt to eliminate all self-interest from our action. It is somewhat utilitarian because it is saying we should base our actions on what will benefit the majority of people the most.
2. Act in such a way that you always treat humanity, whether in your own person or the person of any other, never simply as a means, but always at the same time as an end.
This is The Formula of the End In Itself. Kant is stating in this that it is never right to treat a human being as simply a means of working towards some end, but always an end in themselves. Kant described humans as "holy" because of this. It can never be right, therefore, to use any group of people for your goals, or to categorise any group as a minority that doesn't matter. This principle upholds the ideal of no discrimination based on creed, gender or age.
3. So act as if you were through your maxims a law-making member of a Kingdom of ends.
This is The Formula of the Kingdom of Ends. Kant imagined that rational agents working to solve problems would all reach at similar rational decisions, so in-effect any rational agent was making a law that would be agreed upon by all. Any disagreement could be solved by rational debate.