A perfect example of this theory when applied:
‘Someone who contemplates relieving a financial crisis by borrowing money from someone else, promising to repay it in the future while in fact having no intention of doing so. (Notice that this is not the case of finding yourself incapable of keeping a promise originally made in good faith, which would require a different analysis.) The maxim of this action would be that it is permissible to borrow money under false pretenses if you really need it. But as Kant pointed out, making this maxim into a universal law would be clearly self-defeating. The entire practice of lending money on promise presupposes at least the honest intention to repay; if this condition were universally ignored, the (universally) false promises would never be effective as methods of borrowing. Since the universalized maxim is contradictory in and of itself, no one could will it to be law, and Kant concluded that we have a perfect duty (to which there can never be any exceptions whatsoever) not to act in this manner.’
On the other hand:
‘Someone who lives comfortably but contemplates refusing any assistance to people who are struggling under great hardships. The maxim here would be that it is permissible never to help those who are less well-off than ourselves. Although Kant conceded that no direct contradiction would result from the universalization of such a rule of conduct, he argued that no one could consistently will that it become the universal law, since even the most fortunate among us rightly allow for the possibility that we may at some future time find ourselves in need of the benevolence of others. Here we have only an imperfect duty not act so selfishly, since particular instances may require exceptions to the rule when it conflicts either with another imperfect duty (e.g., when I don't have enough money to help everyone in need) or a perfect duty (e.g., if the only way to get more money would be under a false promise).’
So in other words Kant is saying act only in a way that you would want all men to act. So if I want to murder someone; I would need to make this into a universal law, and only then can this action be right. Good actions should be universalisable and free, therefore Kant said one fact is undisputable and that is the existence of a moral law, he said everyone can detect a moral law and have the duty to do so seek for the highest form of good which he called the ‘summum bonum’ . This led him to argue that God exists as no-one on earth can achieve ‘summum bonum’ so there must be someone who can, he defined that someone to be god.