The measure of disorder is called the Entropy.
The second law therefore says that the total entropy will always increase.
Note we can convert work entirely into heat. Since heat cannot be entirely converted to work, we say heat is lower quality than work. Whenever energy is converted from one form to another, some is lost as heat.