The aggregation, arrangement and bonding together of a set of components to form respiratory chain complex IV (also known as cytochrome c oxidase), the terminal member of the respiratory chain of the mitochondrion and some aerobic bacteria. Cytochrom