Open-heart surgery refers to operations performed on the heart that require a patient being placed on the heart-lung bypass machine.   

The heart-lung bypass machine takes over the function of the heart and lungs to provide oxygenated blood to the body.

The heart can be stopped with a solution called "cardioplegia." Cardioplegia is a cold, high-potassium solution. It also protects the heart muscle while it is stopped.

The heart itself can then be opened and repair can be accomplished in a bloodless, still environment. In some situations, when on the cardiopulmonary bypass machine, the heart can be operated upon while still beating, but emptied. This usually occurs when the repair is on the right side and there are no holes between the left and right sides of the heart.