The categorical imperative is an idea of Immanuel Kant, the German philosopher from the late 1700s. It is, in his view, a moral law that applies to all people at all times. Kant formulated three ways of expressing the categorical imperative. The universal law formulation is the first of these formulations.
In the universal law formulation, Kant says that we must think about why we are taking a given action. We have to formulate a rule that is guiding our actions. If our acts are moral, they must be guided by rules that we would be willing to make into universal laws. In other words, when making a decision, you have to make up a rule that tells you what to do and you have to be able to honestly and correctly say that you would be willing to have that rule govern everyone in all situations.
So, let us say that my wife and children are starving and I have to decide whether to steal a loaf of bread from a store to feed them. I first have to determine what rule it is that allows me to steal. I might say that my rule is that everyone should take what they need from others. But surely that would make a terrible universal law. I might say that the rule, then, is that everyone is entitled to steal from another if A) it will do no great harm to the other and B) it is absolutely necessary for the one stealing.
If I am willing to have that law apply to everyone in every situation, then my action is moral. This is the universal law formulation of the categorical imperative.