Removal of the combs, wattles, and earlobes is called dubbing and is used to prevent frostbite and injury and is neccessary for certain breeds to be shown. It is a quick procedure and the birds are only in a small amount of pain for a very short time. Immediately afterwards they're running around eating and dancing as if nothing happened.
Debeaking is used in high production, mainly battery, facilities where canabalism is a problem. Removing the beak prevents the birds from hurting each other, but the real answer to the problem is to simply give the birds more space.