The clone troopers formed the backbone of the Republic's new military that waged war against the forces of the Confederacy of Independent Systems. So symbolic were they of the times, the galaxy-wide conflict that saw their debut took its name from their ranks: the Clone Wars. While the clones were bred to be soldiers, each clone had his own distinct identity, like Commander Cody and Captain Rex.
They were loyal to their Jedi generals and the Supreme Chancellor, often sacrificing themselves when called for. When the Order 66 was given, however, the clone's loyalty to their longtime allies was eclipsed by their clone indoctrination, and the troops attacked the Jedi.